From f4914d8c772620d80830aa08389c968cd4fd11ea Mon Sep 17 00:00:00 2001 From: antham Date: Thu, 9 Nov 2017 22:52:22 +0100 Subject: [PATCH] Simplify code using gofmt -s --- internal/gps/manager_test.go | 6 +++--- internal/gps/pkgtree/digest_test.go | 6 +++--- internal/gps/pkgtree/pkgtree.go | 8 ++++---- internal/gps/pkgtree/pkgtree_test.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/gps/manager_test.go b/internal/gps/manager_test.go index 430d64f9..7023b2a5 100644 --- a/internal/gps/manager_test.go +++ b/internal/gps/manager_test.go @@ -420,10 +420,10 @@ func TestSourceCreationCounts(t *testing.T) { }, "case variance across path and URL-based access": { roots: []ProjectIdentifier{ - ProjectIdentifier{ProjectRoot: ProjectRoot("github.com/sdboyer/gpkt"), Source: "https://github.com/Sdboyer/gpkt"}, - ProjectIdentifier{ProjectRoot: ProjectRoot("github.com/sdboyer/gpkt"), Source: "https://github.com/SdbOyer/gpkt"}, + {ProjectRoot: ProjectRoot("github.com/sdboyer/gpkt"), Source: "https://github.com/Sdboyer/gpkt"}, + {ProjectRoot: ProjectRoot("github.com/sdboyer/gpkt"), Source: "https://github.com/SdbOyer/gpkt"}, mkPI("github.com/sdboyer/gpkt"), - ProjectIdentifier{ProjectRoot: ProjectRoot("github.com/sdboyer/gpkt"), Source: "https://github.com/sdboyeR/gpkt"}, + {ProjectRoot: ProjectRoot("github.com/sdboyer/gpkt"), Source: "https://github.com/sdboyeR/gpkt"}, mkPI("github.com/sdboyeR/gpkt"), }, namecount: 6, diff --git a/internal/gps/pkgtree/digest_test.go b/internal/gps/pkgtree/digest_test.go index c45bfd3e..574b3842 100644 --- a/internal/gps/pkgtree/digest_test.go +++ b/internal/gps/pkgtree/digest_test.go @@ -143,13 +143,13 @@ func TestVerifyDepTree(t *testing.T) { vendorRoot := getTestdataVerifyRoot(t) wantSums := map[string][]byte{ - "github.com/alice/match": []byte{0x7e, 0x10, 0x6, 0x2f, 0x8, 0x3, 0x3c, 0x76, 0xae, 0xbc, 0xa4, 0xc9, 0xec, 0x73, 0x67, 0x15, 0x70, 0x2b, 0x0, 0x89, 0x27, 0xbb, 0x61, 0x9d, 0xc7, 0xc3, 0x39, 0x46, 0x3, 0x91, 0xb7, 0x3b}, + "github.com/alice/match": {0x7e, 0x10, 0x6, 0x2f, 0x8, 0x3, 0x3c, 0x76, 0xae, 0xbc, 0xa4, 0xc9, 0xec, 0x73, 0x67, 0x15, 0x70, 0x2b, 0x0, 0x89, 0x27, 0xbb, 0x61, 0x9d, 0xc7, 0xc3, 0x39, 0x46, 0x3, 0x91, 0xb7, 0x3b}, "github.com/alice/mismatch": []byte("some non-matching digest"), "github.com/bob/emptyDigest": nil, // empty hash result - "github.com/bob/match": []byte{0x7e, 0x10, 0x6, 0x2f, 0x8, 0x3, 0x3c, 0x76, 0xae, 0xbc, 0xa4, 0xc9, 0xec, 0x73, 0x67, 0x15, 0x70, 0x2b, 0x0, 0x89, 0x27, 0xbb, 0x61, 0x9d, 0xc7, 0xc3, 0x39, 0x46, 0x3, 0x91, 0xb7, 0x3b}, + "github.com/bob/match": {0x7e, 0x10, 0x6, 0x2f, 0x8, 0x3, 0x3c, 0x76, 0xae, 0xbc, 0xa4, 0xc9, 0xec, 0x73, 0x67, 0x15, 0x70, 0x2b, 0x0, 0x89, 0x27, 0xbb, 0x61, 0x9d, 0xc7, 0xc3, 0x39, 0x46, 0x3, 0x91, 0xb7, 0x3b}, "github.com/charlie/notInTree": nil, // not in tree result ought to superseede empty digest result // matching result at seldomly found directory level - "launchpad.net/match": []byte{0x7e, 0x10, 0x6, 0x2f, 0x8, 0x3, 0x3c, 0x76, 0xae, 0xbc, 0xa4, 0xc9, 0xec, 0x73, 0x67, 0x15, 0x70, 0x2b, 0x0, 0x89, 0x27, 0xbb, 0x61, 0x9d, 0xc7, 0xc3, 0x39, 0x46, 0x3, 0x91, 0xb7, 0x3b}, + "launchpad.net/match": {0x7e, 0x10, 0x6, 0x2f, 0x8, 0x3, 0x3c, 0x76, 0xae, 0xbc, 0xa4, 0xc9, 0xec, 0x73, 0x67, 0x15, 0x70, 0x2b, 0x0, 0x89, 0x27, 0xbb, 0x61, 0x9d, 0xc7, 0xc3, 0x39, 0x46, 0x3, 0x91, 0xb7, 0x3b}, } status, err := VerifyDepTree(vendorRoot, wantSums) diff --git a/internal/gps/pkgtree/pkgtree.go b/internal/gps/pkgtree/pkgtree.go index b552fc9b..7938b890 100644 --- a/internal/gps/pkgtree/pkgtree.go +++ b/internal/gps/pkgtree/pkgtree.go @@ -34,10 +34,10 @@ type Package struct { // vcsRoots is a set of directories we should not descend into in ListPackages when // searching for Go packages var vcsRoots = map[string]struct{}{ - ".git": struct{}{}, - ".bzr": struct{}{}, - ".svn": struct{}{}, - ".hg": struct{}{}, + ".git": {}, + ".bzr": {}, + ".svn": {}, + ".hg": {}, } // ListPackages reports Go package information about all directories in the tree diff --git a/internal/gps/pkgtree/pkgtree_test.go b/internal/gps/pkgtree/pkgtree_test.go index 8b61a61d..b4844d82 100644 --- a/internal/gps/pkgtree/pkgtree_test.go +++ b/internal/gps/pkgtree/pkgtree_test.go @@ -1426,13 +1426,13 @@ func TestListPackages(t *testing.T) { out: PackageTree{ ImportRoot: "noncanonical", Packages: map[string]PackageOrErr{ - "noncanonical": PackageOrErr{ + "noncanonical": { Err: &NonCanonicalImportRoot{ ImportRoot: "noncanonical", Canonical: "canonical", }, }, - "noncanonical/sub": PackageOrErr{ + "noncanonical/sub": { Err: &NonCanonicalImportRoot{ ImportRoot: "noncanonical", Canonical: "canonical/subpackage",