Skip to content

Commit 746420e

Browse files
authored
Merge pull request #1159 from bbr32/clean-up-date-comment-and-sprintf
Clean up: date comment & fmt.Sprintf
2 parents e183e8a + f795eb1 commit 746420e

5 files changed

+12
-10
lines changed

internal/provider/resource_gitlab_group_ldap_link_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func TestAccGitlabGroupLdapLink_basic(t *testing.T) {
3737
Check: resource.ComposeTestCheckFunc(
3838
testAccCheckGitlabGroupLdapLinkExists(resourceName, &ldapLink),
3939
testAccCheckGitlabGroupLdapLinkAttributes(&ldapLink, &testAccGitlabGroupLdapLinkExpectedAttributes{
40-
accessLevel: fmt.Sprintf("developer"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
40+
accessLevel: "developer",
4141
})),
4242
},
4343

@@ -57,7 +57,7 @@ func TestAccGitlabGroupLdapLink_basic(t *testing.T) {
5757
Check: resource.ComposeTestCheckFunc(
5858
testAccCheckGitlabGroupLdapLinkExists(resourceName, &ldapLink),
5959
testAccCheckGitlabGroupLdapLinkAttributes(&ldapLink, &testAccGitlabGroupLdapLinkExpectedAttributes{
60-
accessLevel: fmt.Sprintf("maintainer"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
60+
accessLevel: "maintainer",
6161
})),
6262
},
6363
},

internal/provider/resource_gitlab_group_membership.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ var _ = registerResource("gitlab_group_membership", func() *schema.Resource {
5050
},
5151
"expires_at": {
5252
Description: "Expiration date for the group membership. Format: `YYYY-MM-DD`",
53-
Type: schema.TypeString, // Format YYYY-MM-DD
53+
Type: schema.TypeString,
5454
ValidateFunc: validateDateFunc,
5555
Optional: true,
5656
},
@@ -166,6 +166,8 @@ func resourceGitlabGroupMembershipSetToState(d *schema.ResourceData, groupMember
166166
d.Set("access_level", accessLevelValueToName[groupMember.AccessLevel])
167167
if groupMember.ExpiresAt != nil {
168168
d.Set("expires_at", groupMember.ExpiresAt.String())
169+
} else {
170+
d.Set("expires_at", "")
169171
}
170172
userId := strconv.Itoa(groupMember.ID)
171173
d.SetId(buildTwoPartID(groupId, &userId))

internal/provider/resource_gitlab_group_membership_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ func TestAccGitlabGroupMembership_basic(t *testing.T) {
2727
{
2828
Config: testAccGitlabGroupMembershipConfig(rInt),
2929
Check: resource.ComposeTestCheckFunc(testAccCheckGitlabGroupMembershipExists("gitlab_group_membership.foo", &groupMember), testAccCheckGitlabGroupMembershipAttributes(&groupMember, &testAccGitlabGroupMembershipExpectedAttributes{
30-
accessLevel: fmt.Sprintf("developer"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
30+
accessLevel: "developer",
3131
})),
3232
},
3333

3434
//Update the group member to change the access level (use testAccGitlabGroupMembershipUpdateConfig for Config)
3535
{
3636
Config: testAccGitlabGroupMembershipUpdateConfig(rInt),
3737
Check: resource.ComposeTestCheckFunc(testAccCheckGitlabGroupMembershipExists("gitlab_group_membership.foo", &groupMember), testAccCheckGitlabGroupMembershipAttributes(&groupMember, &testAccGitlabGroupMembershipExpectedAttributes{
38-
accessLevel: fmt.Sprintf("guest"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
39-
expiresAt: fmt.Sprintf("2099-01-01"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
38+
accessLevel: "guest",
39+
expiresAt: "2099-01-01",
4040
})),
4141
},
4242

4343
// Update the group member to change the access level back
4444
{
4545
Config: testAccGitlabGroupMembershipConfig(rInt),
4646
Check: resource.ComposeTestCheckFunc(testAccCheckGitlabGroupMembershipExists("gitlab_group_membership.foo", &groupMember), testAccCheckGitlabGroupMembershipAttributes(&groupMember, &testAccGitlabGroupMembershipExpectedAttributes{
47-
accessLevel: fmt.Sprintf("developer"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
47+
accessLevel: "developer",
4848
})),
4949
},
5050
},

internal/provider/resource_gitlab_group_share_group.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var _ = registerResource("gitlab_group_share_group", func() *schema.Resource {
4848
},
4949
"expires_at": {
5050
Description: "Share expiration date. Format: `YYYY-MM-DD`",
51-
Type: schema.TypeString, // Format YYYY-MM-DD
51+
Type: schema.TypeString,
5252
ValidateFunc: validateDateFunc,
5353
ForceNew: true,
5454
Optional: true,

internal/provider/resource_gitlab_project_membership_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func TestAccGitlabProjectMembership_basic(t *testing.T) {
2727
{
2828
Config: testAccGitlabProjectMembershipConfig(rInt),
2929
Check: resource.ComposeTestCheckFunc(testAccCheckGitlabProjectMembershipExists("gitlab_project_membership.foo", &membership), testAccCheckGitlabProjectMembershipAttributes(&membership, &testAccGitlabProjectMembershipExpectedAttributes{
30-
access_level: fmt.Sprintf("developer"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
30+
access_level: "developer",
3131
})),
3232
},
3333

@@ -44,7 +44,7 @@ func TestAccGitlabProjectMembership_basic(t *testing.T) {
4444
{
4545
Config: testAccGitlabProjectMembershipConfig(rInt),
4646
Check: resource.ComposeTestCheckFunc(testAccCheckGitlabProjectMembershipExists("gitlab_project_membership.foo", &membership), testAccCheckGitlabProjectMembershipAttributes(&membership, &testAccGitlabProjectMembershipExpectedAttributes{
47-
access_level: fmt.Sprintf("developer"), // nolint // TODO: Resolve this golangci-lint issue: S1039: unnecessary use of fmt.Sprintf (gosimple)
47+
access_level: "developer",
4848
})),
4949
},
5050
},

0 commit comments

Comments
 (0)