Skip to content

Commit

Permalink
.golangci: update disabled linters
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemouton committed Nov 20, 2023
1 parent 4ad5703 commit 907a79b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ linters-settings:
linters:
enable-all: true
disable:
# Allow dynamic errors.
- goerr113

# We want to allow short variable names.
- varnamelen

# Init functions are used by loggers throughout the codebase.
- gochecknoinits

Expand All @@ -46,6 +52,11 @@ linters:
# instances are created.
- exhaustruct

# Disable gofumpt as it has weird behavior regarding formatting multiple
# lines for a function which is in conflict with our contribution
# guidelines. See https://github.com/mvdan/gofumpt/issues/235.
- gofumpt

# Deprecated linters. See https://golangci-lint.run/usage/linters/.
- interfacer
- golint
Expand Down
11 changes: 8 additions & 3 deletions gbn/gbn_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ func (g *GoBackNConn) clientHandshake() error {
}
}()

var resp Message
var (
resp Message
respSYN *PacketSYN
)
handshake:
for {
// start Handshake
Expand Down Expand Up @@ -148,8 +151,10 @@ handshake:

g.log.Debugf("Got %T", resp)

switch resp.(type) {
switch r := resp.(type) {
case *PacketSYN:
respSYN = r

break handshake
default:
}
Expand All @@ -162,7 +167,7 @@ handshake:

g.log.Debugf("Got SYN")

if resp.(*PacketSYN).N != g.cfg.n {
if respSYN.N != g.cfg.n {
return io.EOF
}

Expand Down
2 changes: 1 addition & 1 deletion gbn/gbn_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type GoBackNConn struct {
// remoteClosed is closed if the remote party initiated the FIN sequence.
remoteClosed chan struct{}

ctx context.Context
ctx context.Context //nolint:containedctx
cancel func()

// quit is used to stop the normal operations of the connection.
Expand Down
2 changes: 1 addition & 1 deletion mailbox/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Server struct {

sid [64]byte

ctx context.Context
ctx context.Context //nolint:containedctx

quit chan struct{}
cancel func()
Expand Down

0 comments on commit 907a79b

Please sign in to comment.