Skip to content

Commit b17fe7e

Browse files
committed
Replace diff suppression with statefunc which stores username as lowercase
Signed-off-by: Timo Sand <timo.sand@f-secure.com>
1 parent 6dd4b5a commit b17fe7e

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

github/resource_github_team_members.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,19 @@ func resourceGithubTeamMembers() *schema.Resource {
6464
Required: true,
6565
Description: "List of users that should be members of the team.",
6666
Set: func(v any) int {
67-
username := v.(map[string]any)["username"].(string)
67+
username, _ := v.(map[string]any)["username"].(string)
6868
return schema.HashString(strings.ToLower(username))
6969
},
7070
Elem: &schema.Resource{
7171
Schema: map[string]*schema.Schema{
7272
"username": {
73-
Type: schema.TypeString,
74-
Required: true,
75-
DiffSuppressFunc: caseInsensitive(),
76-
Description: "User to add to the team.",
73+
Type: schema.TypeString,
74+
Required: true,
75+
StateFunc: func(v any) string {
76+
val, _ := v.(string)
77+
return strings.ToLower(val)
78+
},
79+
Description: "User to add to the team.",
7780
},
7881
"role": {
7982
Type: schema.TypeString,

0 commit comments

Comments
 (0)