add the stylecheck linter

This commit is contained in:
Marten Seemann
2019-09-13 13:53:21 +07:00
parent ab2b26a5cb
commit 6b22f36d82
19 changed files with 30 additions and 20 deletions

View File

@@ -44,7 +44,7 @@ var _ = Describe("Stream Cancelations", func() {
str, err := sess.OpenUniStreamSync(context.Background())
Expect(err).ToNot(HaveOccurred())
if _, err = str.Write(testserver.PRData); err != nil {
Expect(err).To(MatchError(fmt.Sprintf("Stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
Expect(err).To(MatchError(fmt.Sprintf("stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
atomic.AddInt32(&canceledCounter, 1)
return
}
@@ -174,7 +174,7 @@ var _ = Describe("Stream Cancelations", func() {
data, err := ioutil.ReadAll(str)
if err != nil {
atomic.AddInt32(&counter, 1)
Expect(err).To(MatchError(fmt.Sprintf("Stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
Expect(err).To(MatchError(fmt.Sprintf("stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
return
}
Expect(data).To(Equal(testserver.PRData))
@@ -281,7 +281,7 @@ var _ = Describe("Stream Cancelations", func() {
return
}
if _, err = str.Write(testserver.PRData); err != nil {
Expect(err).To(MatchError(fmt.Sprintf("Stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
Expect(err).To(MatchError(fmt.Sprintf("stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
return
}
Expect(str.Close()).To(Succeed())
@@ -314,7 +314,7 @@ var _ = Describe("Stream Cancelations", func() {
}
data, err := ioutil.ReadAll(str)
if err != nil {
Expect(err).To(MatchError(fmt.Sprintf("Stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
Expect(err).To(MatchError(fmt.Sprintf("stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
return
}
atomic.AddInt32(&counter, 1)
@@ -355,7 +355,7 @@ var _ = Describe("Stream Cancelations", func() {
length = int(rand.Int31n(int32(len(testserver.PRData) - 1)))
}
if _, err = str.Write(testserver.PRData[:length]); err != nil {
Expect(err).To(MatchError(fmt.Sprintf("Stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
Expect(err).To(MatchError(fmt.Sprintf("stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
return
}
if length < len(testserver.PRData) {
@@ -396,7 +396,7 @@ var _ = Describe("Stream Cancelations", func() {
}
data, err := ioutil.ReadAll(r)
if err != nil {
Expect(err).To(MatchError(fmt.Sprintf("Stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
Expect(err).To(MatchError(fmt.Sprintf("stream %d was reset with error code %d", str.StreamID(), str.StreamID())))
return
}
Expect(data).To(Equal(testserver.PRData[:length]))

View File

@@ -9,7 +9,9 @@ import (
"github.com/lucas-clemente/quic-go/internal/utils"
//nolint:stylecheck
. "github.com/onsi/ginkgo"
//nolint:stylecheck
. "github.com/onsi/gomega"
)

View File

@@ -12,7 +12,9 @@ import (
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/testdata"
//nolint:stylecheck
. "github.com/onsi/ginkgo"
//nolint:stylecheck
. "github.com/onsi/gomega"
)