diff --git a/Makefile b/Makefile index 2f5a2f4b38..342e8f90be 100644 --- a/Makefile +++ b/Makefile @@ -80,9 +80,6 @@ check-all: lint check-static check-shadow check-gosec megacheck errcheck check-setup: @which retool >/dev/null 2>&1 || go get github.com/twitchtv/retool @GO111MODULE=off retool sync - # govet doesn't work with retool for Go 1.11 - # so install separately - @GO111MODULE=on CGO_ENABLED=0 go get github.com/dnephin/govet@4a96d43e39d340b63daa8bc5576985aa599885f6 check: check-setup lint check-static @@ -90,8 +87,8 @@ check-static: @ # Not running vet and fmt through metalinter becauase it ends up looking at vendor @echo "gofmt checking" gofmt -s -l -w $(FILES) 2>&1| $(FAIL_ON_STDOUT) - @echo "govet check" - govet -all $$($(PACKAGE_DIRECTORIES)) 2>&1 + @echo "go vet check" + @GO111MODULE=on go vet -all $$($(PACKAGE_LIST)) 2>&1 @echo "mispell and ineffassign checking" CGO_ENABLED=0 retool do gometalinter.v2 --disable-all \ --enable misspell \ @@ -114,8 +111,9 @@ errcheck: # TODO: shadow check fails at the moment check-shadow: - @echo "govet shadow checking" - govet -shadow $$($(PACKAGE_DIRECTORIES)) + @echo "go vet shadow checking" + go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow + @GO111MODULE=on go vet -vettool=$(which shadow) $$($(PACKAGE_LIST)) lint: @echo "linting" diff --git a/go.sum b/go.sum index 8626eb0c4c..1865a3364c 100644 --- a/go.sum +++ b/go.sum @@ -63,6 +63,7 @@ github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ0dwoRHP0= github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M= github.com/go-openapi/jsonreference v0.17.0 h1:yJW3HCkTHg7NOA+gZ83IPHzUSnUzGXhGmsdiCcMexbA= github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I= diff --git a/tests/backup/backupcase.go b/tests/backup/backupcase.go index 9c9991ac31..4c39178f6e 100644 --- a/tests/backup/backupcase.go +++ b/tests/backup/backupcase.go @@ -102,12 +102,12 @@ func (bc *BackupCase) Run() error { glog.Infof("waiting 1 minutes for binlog to work") time.Sleep(1 * time.Minute) - glog.Infof("cluster[%s] begin insert data") + glog.Infof("cluster[%s] begin insert data", bc.srcCluster.ClusterName) go bc.operator.BeginInsertDataTo(bc.srcCluster) time.Sleep(30 * time.Second) - glog.Infof("cluster[%s] stop insert data") + glog.Infof("cluster[%s] stop insert data", bc.srcCluster.ClusterName) bc.operator.StopInsertDataTo(bc.srcCluster) time.Sleep(5 * time.Second) diff --git a/tests/pkg/blockwriter/blockwriter.go b/tests/pkg/blockwriter/blockwriter.go index 49d62afdf4..bc53dd920a 100644 --- a/tests/pkg/blockwriter/blockwriter.go +++ b/tests/pkg/blockwriter/blockwriter.go @@ -137,7 +137,7 @@ func (c *BlockWriterCase) generateQuery(ctx context.Context, queryChan chan []st func (bw *blockWriter) batchExecute(db *sql.DB, query string) error { _, err := db.Exec(query) if err != nil { - glog.V(4).Infof("[%s] exec sql [%s] failed, err: %v", query, err) + glog.V(4).Infof("exec sql [%s] failed, err: %v", query, err) return err } diff --git a/tests/pkg/metrics/annotation_util.go b/tests/pkg/metrics/annotation_util.go index 661ffcc121..a07fafeb91 100644 --- a/tests/pkg/metrics/annotation_util.go +++ b/tests/pkg/metrics/annotation_util.go @@ -44,10 +44,10 @@ type Annotation struct { //AnnotationOptions is the query options to a standard REST list call. type AnnotationOptions struct { - DashboardId int `json:"dashboardId, omitempty"` - PanelId int `json:"panelId, omitempty"` - IsRegin bool `json:"isRegion, omitempty"` - TimeEnd int64 `json:"timeEnd, omitempty"` + DashboardId int `json:"dashboardId,omitempty"` + PanelId int `json:"panelId,omitempty"` + IsRegin bool `json:"isRegion,omitempty"` + TimeEnd int64 `json:"timeEnd,omitempty"` } //NewClient creats a new grafanaClient. This client performs rest functions