forked from quic-go/quic-go
Merge pull request #2372 from lucas-clemente/no-ginkgo-lint
remove stray GinkgoRecover(), add a lint script to check that
This commit is contained in:
24
.travis/no_ginkgo.sh
Executable file
24
.travis/no_ginkgo.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Verify that no non-test files import Ginkgo or Gomega.
|
||||
|
||||
set -e
|
||||
|
||||
HAS_TESTING=false
|
||||
|
||||
cd ..
|
||||
for f in $(find . -name "*.go" ! -name "*_test.go"); do
|
||||
if grep -q "github.com/onsi/ginkgo" $f; then
|
||||
echo "$f imports github.com/onsi/ginkgo"
|
||||
HAS_TESTING=true
|
||||
fi
|
||||
if grep -q "github.com/onsi/gomega" $f; then
|
||||
echo "$f imports github.com/onsi/gomega"
|
||||
HAS_TESTING=true
|
||||
fi
|
||||
done
|
||||
|
||||
if "$HAS_TESTING"; then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
@@ -3,6 +3,7 @@
|
||||
set -ex
|
||||
|
||||
if [ ${TESTMODE} == "lint" ]; then
|
||||
.travis/no_ginkgo.sh
|
||||
./bin/golangci-lint run ./...
|
||||
fi
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"github.com/lucas-clemente/quic-go"
|
||||
"github.com/lucas-clemente/quic-go/internal/utils"
|
||||
"github.com/marten-seemann/qpack"
|
||||
"github.com/onsi/ginkgo"
|
||||
)
|
||||
|
||||
// allows mocking of quic.Listen and quic.ListenAddr
|
||||
@@ -198,7 +197,6 @@ func (s *Server) handleConn(sess quic.EarlySession) {
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
defer ginkgo.GinkgoRecover()
|
||||
rerr := s.handleRequest(sess, str, decoder, func() {
|
||||
sess.CloseWithError(quic.ErrorCode(errorFrameUnexpected), "")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user