Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace govet with official vet tool #416

Merged
merged 1 commit into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,15 @@ 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

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 \
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
4 changes: 2 additions & 2 deletions tests/backup/backupcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/pkg/blockwriter/blockwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 4 additions & 4 deletions tests/pkg/metrics/annotation_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down