Skip to content

Commit 4542bf0

Browse files
Apply suggestions from code review
Co-authored-by: Yolan Romailler <[email protected]>
1 parent 9a75d7d commit 4542bf0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/create/wizard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func mkActFunc(tpl Template, s *root.Store, cb ActionCallback) func(context.Cont
225225
if v.Min > 0 && len(sv) < v.Min {
226226
return fmt.Errorf("%s is too short (needs %d)", v.Name, v.Min)
227227
}
228-
if v.Max > 0 && len(sv) > v.Min {
228+
if v.Max > 0 && len(sv) > v.Max {
229229
return fmt.Errorf("%s is too long (at most %d)", v.Name, v.Max)
230230
}
231231
if wantForName[k] {
@@ -268,7 +268,7 @@ func mkActFunc(tpl Template, s *root.Store, cb ActionCallback) func(context.Cont
268268
if v.Min > 0 && len(password) < v.Min {
269269
return fmt.Errorf("%s is too short (needs %d)", v.Name, v.Min)
270270
}
271-
if v.Max > 0 && len(password) > v.Min {
271+
if v.Max > 0 && len(password) > v.Max {
272272
return fmt.Errorf("%s is too long (at most %d)", v.Name, v.Max)
273273
}
274274
}

0 commit comments

Comments
 (0)