Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Commit 2d16443

Browse files
authored
Merge pull request #1099 from carolynvs/fix-analyzer-name
cmd/dep: fix analyzer to always use the same name
2 parents e33547d + 0e74a8d commit 2d16443

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

cmd/dep/root_analyzer.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,11 @@ func (a *rootAnalyzer) FinalizeRootManifestAndLock(m *dep.Manifest, l *dep.Lock,
161161
}
162162
}
163163

164+
// Info provides metadata on the analyzer algorithm used during solve.
164165
func (a *rootAnalyzer) Info() gps.ProjectAnalyzerInfo {
165-
name := "dep"
166-
version := 1
167-
if !a.skipTools {
168-
name = "dep+import"
169-
}
170166
return gps.ProjectAnalyzerInfo{
171-
Name: name,
172-
Version: version,
167+
Name: "dep",
168+
Version: 1,
173169
}
174170
}
175171

cmd/dep/root_analyzer_test.go

-14
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@ import (
1414
"github.com/pkg/errors"
1515
)
1616

17-
func TestRootAnalyzer_Info(t *testing.T) {
18-
testCases := map[bool]string{
19-
true: "dep",
20-
false: "dep+import",
21-
}
22-
for skipTools, want := range testCases {
23-
a := rootAnalyzer{skipTools: skipTools}
24-
got := a.Info().Name
25-
if got != want {
26-
t.Errorf("Expected the name of the importer with skipTools=%t to be '%s', got '%s'", skipTools, want, got)
27-
}
28-
}
29-
}
30-
3117
func TestLookupVersionForLockedProject_MatchRevisionToTag(t *testing.T) {
3218
h := test.NewHelper(t)
3319
defer h.Cleanup()

0 commit comments

Comments
 (0)