From 12866e7ee7395f990facc4a5761d686131884b53 Mon Sep 17 00:00:00 2001 From: Michael Tibben Date: Tue, 18 Feb 2020 14:17:13 +1100 Subject: [PATCH] Use -s with gofmt --- .github/workflows/go.yml | 2 +- vault/config_test.go | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index cb9ebcf6d..a5b505d14 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -33,4 +33,4 @@ jobs: run: go vet ./... - name: Check go fmt - run: diff -u <(echo -n) <(gofmt -d $(git ls-files '*.go')) + run: diff -u <(echo -n) <(gofmt -s -d .) diff --git a/vault/config_test.go b/vault/config_test.go index 11b5ae88b..8e99ac1ca 100644 --- a/vault/config_test.go +++ b/vault/config_test.go @@ -159,12 +159,12 @@ func TestProfilesFromConfig(t *testing.T) { } expected := []vault.ProfileSection{ - vault.ProfileSection{Name: "default", Region: "us-west-2"}, - vault.ProfileSection{Name: "user2", Region: "us-east-1"}, - vault.ProfileSection{Name: "withsource", Region: "us-east-1", SourceProfile: "user2"}, - vault.ProfileSection{Name: "withmfa", MfaSerial: "arn:aws:iam::1234513441:mfa/blah", RoleARN: "arn:aws:iam::4451234513441615400570:role/aws_admin", Region: "us-east-1", DurationSeconds: 1200, SourceProfile: "user2"}, - vault.ProfileSection{Name: "testparentprofile1", Region: "us-east-1"}, - vault.ProfileSection{Name: "testparentprofile2", ParentProfile: "testparentprofile1"}, + {Name: "default", Region: "us-west-2"}, + {Name: "user2", Region: "us-east-1"}, + {Name: "withsource", Region: "us-east-1", SourceProfile: "user2"}, + {Name: "withmfa", MfaSerial: "arn:aws:iam::1234513441:mfa/blah", RoleARN: "arn:aws:iam::4451234513441615400570:role/aws_admin", Region: "us-east-1", DurationSeconds: 1200, SourceProfile: "user2"}, + {Name: "testparentprofile1", Region: "us-east-1"}, + {Name: "testparentprofile2", ParentProfile: "testparentprofile1"}, } actual := cfg.ProfileSections() @@ -193,13 +193,13 @@ func TestAddProfileToExistingConfig(t *testing.T) { } expected := []vault.ProfileSection{ - vault.ProfileSection{Name: "default", Region: "us-west-2"}, - vault.ProfileSection{Name: "user2", Region: "us-east-1"}, - vault.ProfileSection{Name: "withsource", Region: "us-east-1", SourceProfile: "user2"}, - vault.ProfileSection{Name: "withmfa", MfaSerial: "arn:aws:iam::1234513441:mfa/blah", RoleARN: "arn:aws:iam::4451234513441615400570:role/aws_admin", Region: "us-east-1", DurationSeconds: 1200, SourceProfile: "user2"}, - vault.ProfileSection{Name: "testparentprofile1", Region: "us-east-1"}, - vault.ProfileSection{Name: "testparentprofile2", ParentProfile: "testparentprofile1"}, - vault.ProfileSection{Name: "llamas", MfaSerial: "testserial", Region: "us-east-1", SourceProfile: "default"}, + {Name: "default", Region: "us-west-2"}, + {Name: "user2", Region: "us-east-1"}, + {Name: "withsource", Region: "us-east-1", SourceProfile: "user2"}, + {Name: "withmfa", MfaSerial: "arn:aws:iam::1234513441:mfa/blah", RoleARN: "arn:aws:iam::4451234513441615400570:role/aws_admin", Region: "us-east-1", DurationSeconds: 1200, SourceProfile: "user2"}, + {Name: "testparentprofile1", Region: "us-east-1"}, + {Name: "testparentprofile2", ParentProfile: "testparentprofile1"}, + {Name: "llamas", MfaSerial: "testserial", Region: "us-east-1", SourceProfile: "default"}, } actual := cfg.ProfileSections()