run golangci-lint and apply suggested fixes

This commit is contained in:
Christian Schwarz
2019-03-22 20:45:27 +01:00
parent afed762774
commit 5b97953bfb
67 changed files with 413 additions and 353 deletions
-2
View File
@@ -1,7 +1,6 @@
package frameconn
import (
"bufio"
"encoding/binary"
"errors"
"fmt"
@@ -48,7 +47,6 @@ func (f *FrameHeader) Unmarshal(buf []byte) {
type Conn struct {
readMtx, writeMtx sync.Mutex
nc timeoutconn.Conn
ncBuf *bufio.ReadWriter
readNextValid bool
readNext FrameHeader
nextReadErr error
@@ -10,17 +10,11 @@ type shutdownFSM struct {
type shutdownFSMState uint32
const (
// zero value is important
shutdownStateOpen shutdownFSMState = iota
shutdownStateBegin
)
func newShutdownFSM() *shutdownFSM {
fsm := &shutdownFSM{
state: shutdownStateOpen,
}
return fsm
}
func (f *shutdownFSM) Begin() (thisCallStartedShutdown bool) {
f.mtx.Lock()
defer f.mtx.Unlock()