Commit d323f32b authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #8 from libp2p/feat/go-vet

fix go vet issues and add go vet to CI scripts
parents 02dc9400 49aab9a2
...@@ -11,6 +11,7 @@ install: true ...@@ -11,6 +11,7 @@ install: true
script: script:
- make deps - make deps
- go vet
- go test ./... - go test ./...
cache: cache:
...@@ -18,4 +19,4 @@ cache: ...@@ -18,4 +19,4 @@ cache:
- $GOPATH/src/gx - $GOPATH/src/gx
notifications: notifications:
email: false email: false
\ No newline at end of file
...@@ -323,7 +323,7 @@ func TestBootstrap(t *testing.T) { ...@@ -323,7 +323,7 @@ func TestBootstrap(t *testing.T) {
stop := make(chan struct{}) stop := make(chan struct{})
go func() { go func() {
for { for {
t.Logf("bootstrapping them so they find each other", nDHTs) t.Logf("bootstrapping them so they find each other %d", nDHTs)
ctxT, _ := context.WithTimeout(ctx, 5*time.Second) ctxT, _ := context.WithTimeout(ctx, 5*time.Second)
bootstrap(t, ctxT, dhts) bootstrap(t, ctxT, dhts)
...@@ -392,7 +392,7 @@ func TestPeriodicBootstrap(t *testing.T) { ...@@ -392,7 +392,7 @@ func TestPeriodicBootstrap(t *testing.T) {
} }
go amplify(signal, allSignals) go amplify(signal, allSignals)
t.Logf("dhts are not connected.", nDHTs) t.Logf("dhts are not connected. %d", nDHTs)
for _, dht := range dhts { for _, dht := range dhts {
rtlen := dht.routingTable.Size() rtlen := dht.routingTable.Size()
if rtlen > 0 { if rtlen > 0 {
...@@ -404,7 +404,7 @@ func TestPeriodicBootstrap(t *testing.T) { ...@@ -404,7 +404,7 @@ func TestPeriodicBootstrap(t *testing.T) {
connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)]) connect(t, ctx, dhts[i], dhts[(i+1)%len(dhts)])
} }
t.Logf("DHTs are now connected to 1-2 others.", nDHTs) t.Logf("DHTs are now connected to 1-2 others. %d", nDHTs)
for _, dht := range dhts { for _, dht := range dhts {
rtlen := dht.routingTable.Size() rtlen := dht.routingTable.Size()
if rtlen > 2 { if rtlen > 2 {
...@@ -416,7 +416,7 @@ func TestPeriodicBootstrap(t *testing.T) { ...@@ -416,7 +416,7 @@ func TestPeriodicBootstrap(t *testing.T) {
printRoutingTables(dhts) printRoutingTables(dhts)
} }
t.Logf("bootstrapping them so they find each other", nDHTs) t.Logf("bootstrapping them so they find each other. %d", nDHTs)
signal <- time.Now() signal <- time.Now()
// this is async, and we dont know when it's finished with one cycle, so keep checking // this is async, and we dont know when it's finished with one cycle, so keep checking
...@@ -448,7 +448,7 @@ func TestProvidesMany(t *testing.T) { ...@@ -448,7 +448,7 @@ func TestProvidesMany(t *testing.T) {
} }
<-time.After(100 * time.Millisecond) <-time.After(100 * time.Millisecond)
t.Logf("bootstrapping them so they find each other", nDHTs) t.Logf("bootstrapping them so they find each other. %d", nDHTs)
ctxT, _ := context.WithTimeout(ctx, 20*time.Second) ctxT, _ := context.WithTimeout(ctx, 20*time.Second)
bootstrap(t, ctxT, dhts) bootstrap(t, ctxT, dhts)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment