Travis: add staticcheck (#1019)

Also only run golint and go vet in Go 1.8, and fix some vet failures.
This commit is contained in:
Tamir Duberstein
2017-05-15 20:05:27 -04:00
committed by dfawley
parent e2f22b027b
commit 3773797869
5 changed files with 172 additions and 166 deletions

View File

@ -73,7 +73,7 @@ func runStream(b *testing.B, maxConcurrentCalls int) {
streamCaller(stream)
}
ch := make(chan int, maxConcurrentCalls*4)
ch := make(chan struct{}, maxConcurrentCalls*4)
var (
mu sync.Mutex
wg sync.WaitGroup
@ -82,11 +82,11 @@ func runStream(b *testing.B, maxConcurrentCalls int) {
// Distribute the b.N calls over maxConcurrentCalls workers.
for i := 0; i < maxConcurrentCalls; i++ {
stream, err := tc.StreamingCall(context.Background())
if err != nil {
b.Fatalf("%v.StreamingCall(_) = _, %v", tc, err)
}
go func() {
stream, err := tc.StreamingCall(context.Background())
if err != nil {
b.Fatalf("%v.StreamingCall(_) = _, %v", tc, err)
}
for range ch {
start := time.Now()
streamCaller(stream)
@ -100,7 +100,7 @@ func runStream(b *testing.B, maxConcurrentCalls int) {
}
b.StartTimer()
for i := 0; i < b.N; i++ {
ch <- i
ch <- struct{}{}
}
b.StopTimer()
close(ch)