From 2efe1c6b9d8c41c78bc6342935d23efb5633bc5e Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Thu, 5 Oct 2023 09:29:12 -0700 Subject: [PATCH] Address comments Signed-off-by: Shawn Wang --- nsxt/resource_nsxt_node_user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nsxt/resource_nsxt_node_user.go b/nsxt/resource_nsxt_node_user.go index 7681aeccd..80e41fb7b 100644 --- a/nsxt/resource_nsxt_node_user.go +++ b/nsxt/resource_nsxt_node_user.go @@ -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