Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
Signed-off-by: Shawn Wang <[email protected]>
  • Loading branch information
wsquan171 committed Oct 5, 2023
1 parent 3c2d9a5 commit 2efe1c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nsxt/resource_nsxt_node_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ func validateUsername() schema.SchemaValidateFunc {

r := regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9@-_.\\-]*$")
if ok := r.MatchString(v); !ok {
es = append(es, fmt.Errorf("must be a valid username matching: ^[a-zA-Z][a-zA-Z0-9@-_.\\-]*$"))
es = append(es, fmt.Errorf("username %s is invalid", v))
return
}

if len(v) < 1 || len(v) > 32 {
es = append(es, fmt.Errorf("expected length of %s to be in the range (%d - %d), got %s", k, 1, 32, v))
es = append(es, fmt.Errorf("expected length of %s to be in the range (%d - %d), got %d", k, 1, 32, len(v)))
return
}
return
Expand Down

0 comments on commit 2efe1c6

Please sign in to comment.