Skip to content

Commit a8548dd

Browse files
author
KyleBanks
committed
Go 1.9 fixes
1 parent d3f070e commit a8548dd

File tree

5 files changed

+17
-11
lines changed

5 files changed

+17
-11
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
language: go
22
sudo: false
33
go:
4-
- 1.7.x
5-
- 1.8.x
4+
- 1.9.x
65
before_install:
76
- go get github.com/mattn/goveralls
87
script:

cmd/depth/depth.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ func writePkgSummary(w io.Writer, pkg depth.Pkg) {
8484
collectSummary(&sum, p, set)
8585
}
8686
fmt.Fprintf(w, "%d dependencies (%d internal, %d external, %d testing).\n",
87-
sum.numInternal + sum.numExternal,
88-
sum.numInternal,
89-
sum.numExternal,
90-
sum.numTesting)
87+
sum.numInternal+sum.numExternal,
88+
sum.numInternal,
89+
sum.numExternal,
90+
sum.numTesting)
9191
}
9292

9393
func collectSummary(sum *summary, pkg depth.Pkg, nameSet map[string]struct{}) {

cmd/depth/depth_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ func Example_handlePkgsStrings() {
5353
// Output:
5454
// strings
5555
// ├ errors
56+
// ├ internal/cpu
5657
// ├ io
5758
// ├ unicode
5859
// └ unicode/utf8
59-
// 4 dependencies (4 internal, 0 external, 0 testing).
60+
// 5 dependencies (5 internal, 0 external, 0 testing).
6061

6162
}
6263

@@ -70,6 +71,7 @@ func Example_handlePkgsTestStrings() {
7071
// ├ bytes
7172
// ├ errors
7273
// ├ fmt
74+
// ├ internal/cpu
7375
// ├ io
7476
// ├ io/ioutil
7577
// ├ math/rand
@@ -79,7 +81,7 @@ func Example_handlePkgsTestStrings() {
7981
// ├ unicode
8082
// ├ unicode/utf8
8183
// └ unsafe
82-
// 12 dependencies (12 internal, 0 external, 8 testing).
84+
// 13 dependencies (13 internal, 0 external, 8 testing).
8385
}
8486

8587
func Example_handlePkgsDepth() {
@@ -128,6 +130,11 @@ func Example_handlePkgsJson() {
128130
// "deps": null
129131
// },
130132
// {
133+
// "name": "internal/cpu",
134+
// "resolved": true,
135+
// "deps": null
136+
// },
137+
// {
131138
// "name": "io",
132139
// "resolved": true,
133140
// "deps": null

depth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (t *Tree) Resolve(name string) error {
6767
Name: name,
6868
Tree: t,
6969
SrcDir: pwd,
70-
Test: false,
70+
Test: false,
7171
}
7272

7373
// Reset the import cache each time to ensure a reused Tree doesn't

pkg.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (p *Pkg) Resolve(i Importer) {
6060
}
6161
}
6262

63-
//first we set the regular dependencies, then we add the test dependencies
63+
//first we set the regular dependencies, then we add the test dependencies
6464
//sharing the same set. This allows us to mark all test-only deps linearly
6565
unique := make(map[string]struct{})
6666
p.setDeps(i, pkg.Imports, pkg.Dir, unique, false)
@@ -98,7 +98,7 @@ func (p *Pkg) addDep(i Importer, name string, srcDir string, isTest bool) {
9898
SrcDir: srcDir,
9999
Tree: p.Tree,
100100
Parent: p,
101-
Test: isTest,
101+
Test: isTest,
102102
}
103103
dep.Resolve(i)
104104

0 commit comments

Comments
 (0)