Skip to content
This repository was archived by the owner on Jul 31, 2025. It is now read-only.

Commit fe1e95e

Browse files
mueslijasdel
authored andcommitted
Cleanup unneeded wrapping of values in aws and stscreds package (#2707)
Cleans up unneeded wrapping of values in the aws and stscreds package: * aws: removes pointer dereference for `IsZero` method call. * stscreds: removes anonymous function wrapping `time.Now`
1 parent 5516892 commit fe1e95e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

aws/convert_types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ func TestTimeValueSlice(t *testing.T) {
562562
}
563563
for i := range out2 {
564564
if in[i] == nil {
565-
if !(*(out2[i])).IsZero() {
565+
if !(out2[i]).IsZero() {
566566
t.Errorf("Unexpected value at idx %d", idx)
567567
}
568568
} else {

aws/credentials/stscreds/web_identity_provider.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ const (
2626
// now is used to return a time.Time object representing
2727
// the current time. This can be used to easily test and
2828
// compare test values.
29-
var now = func() time.Time {
30-
return time.Now()
31-
}
29+
var now = time.Now
3230

3331
// WebIdentityRoleProvider is used to retrieve credentials using
3432
// an OIDC token.

0 commit comments

Comments
 (0)