Add structcheck, unused, and varcheck linters.
Warn on unused and dead code Signed-off-by: Daniel Nephin <dnephin@gmail.com>
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
"google.golang.org/grpc/grpclog"
|
||||
@@ -196,18 +195,3 @@ func setLevel(context *cli.Context, config *server.Config) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func dumpStacks() {
|
||||
var (
|
||||
buf []byte
|
||||
stackSize int
|
||||
)
|
||||
bufferLen := 16384
|
||||
for stackSize == len(buf) {
|
||||
buf = make([]byte, bufferLen)
|
||||
stackSize = runtime.Stack(buf, true)
|
||||
bufferLen *= 2
|
||||
}
|
||||
buf = buf[:stackSize]
|
||||
logrus.Infof("=== BEGIN goroutine stack dump ===\n%s\n=== END goroutine stack dump ===", buf)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user