Skip to content

Commit

Permalink
Merge pull request #3367 from lucas-clemente/update-golangci-lint
Browse files Browse the repository at this point in the history
stop using the deprecated net.Error.Temporary, update golangci-lint to v1.45.2
  • Loading branch information
marten-seemann committed Apr 3, 2022
2 parents d1498c3 + 7c63050 commit fa0dba9
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Expand Up @@ -28,4 +28,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.41.1
version: v1.45.2
1 change: 0 additions & 1 deletion .golangci.yml
Expand Up @@ -28,7 +28,6 @@ linters:
- ineffassign
- misspell
- prealloc
- scopelint
- staticcheck
- stylecheck
- structcheck
Expand Down
1 change: 0 additions & 1 deletion fuzzing/handshake/fuzz.go
Expand Up @@ -300,7 +300,6 @@ func runHandshake(runConfig [confLen]byte, messageConfig uint8, clientConf *tls.
serverConf.ClientAuth = getClientAuth(runConfig[1] & 0b00000111)
serverConf.CipherSuites = getSuites(runConfig[1] >> 6)
serverConf.SessionTicketsDisabled = helper.NthBit(runConfig[1], 3)
clientConf.PreferServerCipherSuites = helper.NthBit(runConfig[1], 4)
if helper.NthBit(runConfig[2], 0) {
clientConf.RootCAs = x509.NewCertPool()
}
Expand Down
3 changes: 2 additions & 1 deletion internal/handshake/crypto_setup_test.go
Expand Up @@ -260,7 +260,8 @@ var _ = Describe("Crypto Setup TLS", func() {
}

handshake := func(client CryptoSetup, cChunkChan <-chan chunk,
server CryptoSetup, sChunkChan <-chan chunk) {
server CryptoSetup, sChunkChan <-chan chunk,
) {
done := make(chan struct{})
go func() {
defer GinkgoRecover()
Expand Down
3 changes: 0 additions & 3 deletions internal/qerr/errors_test.go
Expand Up @@ -73,7 +73,6 @@ var _ = Describe("QUIC Errors", func() {
nerr, ok := err.(net.Error)
Expect(ok).To(BeTrue())
Expect(nerr.Timeout()).To(BeTrue())
Expect(nerr.Temporary()).To(BeFalse())
Expect(err.Error()).To(Equal("timeout: handshake did not complete in time"))
})

Expand All @@ -84,7 +83,6 @@ var _ = Describe("QUIC Errors", func() {
nerr, ok := err.(net.Error)
Expect(ok).To(BeTrue())
Expect(nerr.Timeout()).To(BeTrue())
Expect(nerr.Temporary()).To(BeFalse())
Expect(err.Error()).To(Equal("timeout: no recent network activity"))
})
})
Expand Down Expand Up @@ -112,7 +110,6 @@ var _ = Describe("QUIC Errors", func() {
nerr, ok := err.(net.Error)
Expect(ok).To(BeTrue())
Expect(nerr.Timeout()).To(BeFalse())
Expect(nerr.Temporary()).To(BeTrue())
})
})

Expand Down
4 changes: 4 additions & 0 deletions packet_handler_map.go
Expand Up @@ -344,6 +344,10 @@ func (h *packetHandlerMap) listen() {
defer close(h.listening)
for {
p, err := h.conn.ReadPacket()
//nolint:staticcheck // SA1019 ignore this!
// TODO: This code is used to ignore wsa errors on Windows.
// Since net.Error.Temporary is deprecated as of Go 1.18, we should find a better solution.
// See https://github.com/lucas-clemente/quic-go/issues/1737 for details.
if nerr, ok := err.(net.Error); ok && nerr.Temporary() {
h.logger.Debugf("Temporary error reading from conn: %w", err)
continue
Expand Down
1 change: 0 additions & 1 deletion receive_stream_test.go
Expand Up @@ -218,7 +218,6 @@ var _ = Describe("Receive Stream", func() {

Context("deadlines", func() {
It("the deadline error has the right net.Error properties", func() {
Expect(errDeadline.Temporary()).To(BeTrue())
Expect(errDeadline.Timeout()).To(BeTrue())
Expect(errDeadline).To(MatchError("deadline exceeded"))
})
Expand Down
1 change: 0 additions & 1 deletion stream_test.go
Expand Up @@ -99,7 +99,6 @@ var _ = Describe("Stream", func() {
var _ = Describe("Deadline Error", func() {
It("is a net.Error that wraps os.ErrDeadlineError", func() {
err := deadlineError{}
Expect(err.Temporary()).To(BeTrue())
Expect(err.Timeout()).To(BeTrue())
Expect(errors.Is(err, os.ErrDeadlineExceeded)).To(BeTrue())
Expect(errors.Unwrap(err)).To(Equal(os.ErrDeadlineExceeded))
Expand Down
1 change: 0 additions & 1 deletion streams_map_test.go
Expand Up @@ -38,7 +38,6 @@ func expectTooManyStreamsError(err error) {
ExpectWithOffset(1, err.Error()).To(Equal(errTooManyOpenStreams.Error()))
nerr, ok := err.(net.Error)
ExpectWithOffset(1, ok).To(BeTrue())
ExpectWithOffset(1, nerr.Temporary()).To(BeTrue())
ExpectWithOffset(1, nerr.Timeout()).To(BeFalse())
}

Expand Down

0 comments on commit fa0dba9

Please sign in to comment.