Skip to content
Snippets Groups Projects
Unverified Commit 314691ad authored by lni's avatar lni Committed by GitHub
Browse files

Makefile: report all errors identified by static-check (#4182)

minor fix for various static check errors escaped from previous runs
parent b4db4a72
No related branches found
No related tags found
No related merge requests found
......@@ -167,10 +167,6 @@ install-static-check-tools:
@go install github.com/apache/skywalking-eyes/cmd/license-eye@latest
@go install honnef.co/go/tools/cmd/staticcheck@latest
# TODO: tracking https://github.com/golangci/golangci-lint/issues/2649
DIRS=pkg/... \
cmd/...
EXTRA_LINTERS=-E exportloopref -E rowserrcheck -E depguard -D unconvert \
-E prealloc -E gofmt
......@@ -178,9 +174,7 @@ STATICCHECK_CHECKS=QF1001,QF1002,QF1003,QF1004,QF1005,QF1006,QF1007,QF1008,QF100
.PHONY: static-check
static-check: config cgo
@$(CGO_OPTS) staticcheck -checks $(STATICCHECK_CHECKS) ./...
@$(CGO_OPTS) go vet -vettool=$(which molint) ./...
@$(CGO_OPTS) license-eye -c .licenserc.yml header check
@for p in $(DIRS); do \
$(CGO_OPTS) golangci-lint run $(EXTRA_LINTERS) $$p ; \
done;
$(CGO_OPTS) staticcheck -checks $(STATICCHECK_CHECKS) ./...
$(CGO_OPTS) go vet -vettool=`which molint` ./...
$(CGO_OPTS) license-eye -c .licenserc.yml header check
$(CGO_OPTS) golangci-lint run $(EXTRA_LINTERS) ./...
......@@ -33,7 +33,9 @@ func NewVisitQuery(qry *Query, rules []VisitRule) *VisitQuery {
func (vq *VisitQuery) exploreNode(node *Node) error {
for i := range node.Children {
vq.exploreNode(vq.qry.Nodes[node.Children[i]])
if err := vq.exploreNode(vq.qry.Nodes[node.Children[i]]); err != nil {
return err
}
}
for _, rule := range vq.rules {
......
......@@ -18,7 +18,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
......@@ -108,7 +107,7 @@ func OpenRotateFile(dir, name string, mu *sync.RWMutex, rotateChecker RotateChec
postCommitFunc: postCommitFunc,
}
if !newDir {
files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
......@@ -123,14 +122,18 @@ func OpenRotateFile(dir, name string, mu *sync.RWMutex, rotateChecker RotateChec
if err != nil {
return nil, err
}
info, err := f.Info()
if err != nil {
return nil, err
}
vf := &vFile{
RWMutex: &sync.RWMutex{},
File: file,
version: version,
commitCond: *sync.NewCond(new(sync.Mutex)),
history: rf.history,
size: int(f.Size()),
syncpos: int(f.Size()),
size: int(info.Size()),
syncpos: int(info.Size()),
}
vf.vInfo = newVInfo(vf)
// vf.ReadMeta()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment