Fix linter issues surfaced by new linter config
Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
parent
4b32f0e040
commit
ef0fdfa63d
|
|
@ -93,7 +93,7 @@ func removeSourceDuplicates(dst, src any) any {
|
||||||
}
|
}
|
||||||
|
|
||||||
result := reflect.New(sliceSrc.Type()).Elem() // we will not modify src
|
result := reflect.New(sliceSrc.Type()).Elem() // we will not modify src
|
||||||
for i := 0; i < sliceSrc.Len(); i++ {
|
for i := range sliceSrc.Len() {
|
||||||
itemSrc := sliceSrc.Index(i)
|
itemSrc := sliceSrc.Index(i)
|
||||||
found := false
|
found := false
|
||||||
for j := 0; j < sliceDst.Len() && !found; j++ {
|
for j := 0; j < sliceDst.Len() && !found; j++ {
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ func Generate() (string, error) {
|
||||||
// Generate a password.
|
// Generate a password.
|
||||||
func (s Settings) Generate() (string, error) {
|
func (s Settings) Generate() (string, error) {
|
||||||
pw := make([]byte, s.Length)
|
pw := make([]byte, s.Length)
|
||||||
for i := 0; i < s.Length; i++ {
|
for i := range s.Length {
|
||||||
n, err := rand.Int(rand.Reader, big.NewInt(int64(len(s.CharacterSet))))
|
n, err := rand.Int(rand.Reader, big.NewInt(int64(len(s.CharacterSet))))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ func ToIntPtrValue(v string) *int64 {
|
||||||
// string pointers and need to be resolved as part of `ResolveMultiple`.
|
// string pointers and need to be resolved as part of `ResolveMultiple`.
|
||||||
func FromPtrValues(v []*string) []string {
|
func FromPtrValues(v []*string) []string {
|
||||||
res := make([]string, len(v))
|
res := make([]string, len(v))
|
||||||
for i := 0; i < len(v); i++ {
|
for i := range len(v) {
|
||||||
res[i] = FromPtrValue(v[i])
|
res[i] = FromPtrValue(v[i])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
@ -116,7 +116,7 @@ func FromPtrValues(v []*string) []string {
|
||||||
// FromFloatPtrValues adapts a slice of float64 pointer fields for use as CurrentValues.
|
// FromFloatPtrValues adapts a slice of float64 pointer fields for use as CurrentValues.
|
||||||
func FromFloatPtrValues(v []*float64) []string {
|
func FromFloatPtrValues(v []*float64) []string {
|
||||||
res := make([]string, len(v))
|
res := make([]string, len(v))
|
||||||
for i := 0; i < len(v); i++ {
|
for i := range len(v) {
|
||||||
res[i] = FromFloatPtrValue(v[i])
|
res[i] = FromFloatPtrValue(v[i])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
@ -125,7 +125,7 @@ func FromFloatPtrValues(v []*float64) []string {
|
||||||
// FromIntPtrValues adapts a slice of int64 pointer fields for use as CurrentValues.
|
// FromIntPtrValues adapts a slice of int64 pointer fields for use as CurrentValues.
|
||||||
func FromIntPtrValues(v []*int64) []string {
|
func FromIntPtrValues(v []*int64) []string {
|
||||||
res := make([]string, len(v))
|
res := make([]string, len(v))
|
||||||
for i := 0; i < len(v); i++ {
|
for i := range len(v) {
|
||||||
res[i] = FromIntPtrValue(v[i])
|
res[i] = FromIntPtrValue(v[i])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
@ -138,7 +138,7 @@ func FromIntPtrValues(v []*int64) []string {
|
||||||
// string pointers and need to be resolved as part of `ResolveMultiple`.
|
// string pointers and need to be resolved as part of `ResolveMultiple`.
|
||||||
func ToPtrValues(v []string) []*string {
|
func ToPtrValues(v []string) []*string {
|
||||||
res := make([]*string, len(v))
|
res := make([]*string, len(v))
|
||||||
for i := 0; i < len(v); i++ {
|
for i := range len(v) {
|
||||||
res[i] = ToPtrValue(v[i])
|
res[i] = ToPtrValue(v[i])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
@ -147,7 +147,7 @@ func ToPtrValues(v []string) []*string {
|
||||||
// ToFloatPtrValues adapts ResolvedValues for use as a slice of float64 pointer fields.
|
// ToFloatPtrValues adapts ResolvedValues for use as a slice of float64 pointer fields.
|
||||||
func ToFloatPtrValues(v []string) []*float64 {
|
func ToFloatPtrValues(v []string) []*float64 {
|
||||||
res := make([]*float64, len(v))
|
res := make([]*float64, len(v))
|
||||||
for i := 0; i < len(v); i++ {
|
for i := range len(v) {
|
||||||
res[i] = ToFloatPtrValue(v[i])
|
res[i] = ToFloatPtrValue(v[i])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
@ -156,7 +156,7 @@ func ToFloatPtrValues(v []string) []*float64 {
|
||||||
// ToIntPtrValues adapts ResolvedValues for use as a slice of int64 pointer fields.
|
// ToIntPtrValues adapts ResolvedValues for use as a slice of int64 pointer fields.
|
||||||
func ToIntPtrValues(v []string) []*int64 {
|
func ToIntPtrValues(v []string) []*int64 {
|
||||||
res := make([]*int64, len(v))
|
res := make([]*int64, len(v))
|
||||||
for i := 0; i < len(v); i++ {
|
for i := range len(v) {
|
||||||
res[i] = ToIntPtrValue(v[i])
|
res[i] = ToIntPtrValue(v[i])
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue