зеркало из https://github.com/golang/dep.git
Simplify code using gofmt -s
This commit is contained in:
Родитель
c47c866e6f
Коммит
f4914d8c77
|
@ -420,10 +420,10 @@ func TestSourceCreationCounts(t *testing.T) {
|
||||||
},
|
},
|
||||||
"case variance across path and URL-based access": {
|
"case variance across path and URL-based access": {
|
||||||
roots: []ProjectIdentifier{
|
roots: []ProjectIdentifier{
|
||||||
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"},
|
||||||
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"),
|
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"),
|
mkPI("github.com/sdboyeR/gpkt"),
|
||||||
},
|
},
|
||||||
namecount: 6,
|
namecount: 6,
|
||||||
|
|
|
@ -143,13 +143,13 @@ func TestVerifyDepTree(t *testing.T) {
|
||||||
vendorRoot := getTestdataVerifyRoot(t)
|
vendorRoot := getTestdataVerifyRoot(t)
|
||||||
|
|
||||||
wantSums := map[string][]byte{
|
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/alice/mismatch": []byte("some non-matching digest"),
|
||||||
"github.com/bob/emptyDigest": nil, // empty hash result
|
"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
|
"github.com/charlie/notInTree": nil, // not in tree result ought to superseede empty digest result
|
||||||
// matching result at seldomly found directory level
|
// 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)
|
status, err := VerifyDepTree(vendorRoot, wantSums)
|
||||||
|
|
|
@ -34,10 +34,10 @@ type Package struct {
|
||||||
// vcsRoots is a set of directories we should not descend into in ListPackages when
|
// vcsRoots is a set of directories we should not descend into in ListPackages when
|
||||||
// searching for Go packages
|
// searching for Go packages
|
||||||
var vcsRoots = map[string]struct{}{
|
var vcsRoots = map[string]struct{}{
|
||||||
".git": struct{}{},
|
".git": {},
|
||||||
".bzr": struct{}{},
|
".bzr": {},
|
||||||
".svn": struct{}{},
|
".svn": {},
|
||||||
".hg": struct{}{},
|
".hg": {},
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListPackages reports Go package information about all directories in the tree
|
// ListPackages reports Go package information about all directories in the tree
|
||||||
|
|
|
@ -1426,13 +1426,13 @@ func TestListPackages(t *testing.T) {
|
||||||
out: PackageTree{
|
out: PackageTree{
|
||||||
ImportRoot: "noncanonical",
|
ImportRoot: "noncanonical",
|
||||||
Packages: map[string]PackageOrErr{
|
Packages: map[string]PackageOrErr{
|
||||||
"noncanonical": PackageOrErr{
|
"noncanonical": {
|
||||||
Err: &NonCanonicalImportRoot{
|
Err: &NonCanonicalImportRoot{
|
||||||
ImportRoot: "noncanonical",
|
ImportRoot: "noncanonical",
|
||||||
Canonical: "canonical",
|
Canonical: "canonical",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"noncanonical/sub": PackageOrErr{
|
"noncanonical/sub": {
|
||||||
Err: &NonCanonicalImportRoot{
|
Err: &NonCanonicalImportRoot{
|
||||||
ImportRoot: "noncanonical",
|
ImportRoot: "noncanonical",
|
||||||
Canonical: "canonical/subpackage",
|
Canonical: "canonical/subpackage",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче