Fix linter issues surfaced by new linter config

Signed-off-by: Nic Cope <nicc@rk0n.org>
This commit is contained in:
Nic Cope 2024-05-29 15:35:37 -07:00
parent 4b32f0e040
commit ef0fdfa63d
3 changed files with 8 additions and 8 deletions

View File

@ -93,7 +93,7 @@ func removeSourceDuplicates(dst, src any) any {
}
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)
found := false
for j := 0; j < sliceDst.Len() && !found; j++ {

View File

@ -48,7 +48,7 @@ func Generate() (string, error) {
// Generate a password.
func (s Settings) Generate() (string, error) {
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))))
if err != nil {
return "", err

View File

@ -107,7 +107,7 @@ func ToIntPtrValue(v string) *int64 {
// string pointers and need to be resolved as part of `ResolveMultiple`.
func FromPtrValues(v []*string) []string {
res := make([]string, len(v))
for i := 0; i < len(v); i++ {
for i := range len(v) {
res[i] = FromPtrValue(v[i])
}
return res
@ -116,7 +116,7 @@ func FromPtrValues(v []*string) []string {
// FromFloatPtrValues adapts a slice of float64 pointer fields for use as CurrentValues.
func FromFloatPtrValues(v []*float64) []string {
res := make([]string, len(v))
for i := 0; i < len(v); i++ {
for i := range len(v) {
res[i] = FromFloatPtrValue(v[i])
}
return res
@ -125,7 +125,7 @@ func FromFloatPtrValues(v []*float64) []string {
// FromIntPtrValues adapts a slice of int64 pointer fields for use as CurrentValues.
func FromIntPtrValues(v []*int64) []string {
res := make([]string, len(v))
for i := 0; i < len(v); i++ {
for i := range len(v) {
res[i] = FromIntPtrValue(v[i])
}
return res
@ -138,7 +138,7 @@ func FromIntPtrValues(v []*int64) []string {
// string pointers and need to be resolved as part of `ResolveMultiple`.
func ToPtrValues(v []string) []*string {
res := make([]*string, len(v))
for i := 0; i < len(v); i++ {
for i := range len(v) {
res[i] = ToPtrValue(v[i])
}
return res
@ -147,7 +147,7 @@ func ToPtrValues(v []string) []*string {
// ToFloatPtrValues adapts ResolvedValues for use as a slice of float64 pointer fields.
func ToFloatPtrValues(v []string) []*float64 {
res := make([]*float64, len(v))
for i := 0; i < len(v); i++ {
for i := range len(v) {
res[i] = ToFloatPtrValue(v[i])
}
return res
@ -156,7 +156,7 @@ func ToFloatPtrValues(v []string) []*float64 {
// ToIntPtrValues adapts ResolvedValues for use as a slice of int64 pointer fields.
func ToIntPtrValues(v []string) []*int64 {
res := make([]*int64, len(v))
for i := 0; i < len(v); i++ {
for i := range len(v) {
res[i] = ToIntPtrValue(v[i])
}
return res