move go vet out of scripts and fixing warning (#12552)

This commit is contained in:
yogy rahmawan
2018-07-10 13:25:32 +07:00
committed by Torkel Ödegaard
parent 25bcdbcab1
commit 8b32dc5847
6 changed files with 8 additions and 8 deletions

View File

@@ -88,6 +88,9 @@ jobs:
- run:
name: run linters
command: 'gometalinter.v2 --enable-gc --vendor --deadline 10m --disable-all --enable=deadcode --enable=ineffassign --enable=structcheck --enable=unconvert --enable=varcheck ./...'
- run:
name: run go vet
command: 'go vet ./pkg/...'
test-frontend:
docker:

View File

@@ -98,8 +98,6 @@ func (ns *NotificationService) Run(ctx context.Context) error {
return ctx.Err()
}
}
return nil
}
func (ns *NotificationService) SendWebhookSync(ctx context.Context, cmd *m.SendWebhookSync) error {

View File

@@ -58,7 +58,9 @@ func (rs *RenderingService) renderViaPhantomJS(ctx context.Context, opts Opts) (
cmdArgs = append([]string{fmt.Sprintf("--output-encoding=%s", opts.Encoding)}, cmdArgs...)
}
commandCtx, _ := context.WithTimeout(ctx, opts.Timeout+time.Second*2)
commandCtx, cancel := context.WithTimeout(ctx, opts.Timeout+time.Second*2)
defer cancel()
cmd := exec.CommandContext(commandCtx, binPath, cmdArgs...)
cmd.Stderr = cmd.Stdout

View File

@@ -218,7 +218,7 @@ func (c *baseClientImpl) ExecuteMultisearch(r *MultiSearchRequest) (*MultiSearch
elapsed := time.Now().Sub(start)
clientLog.Debug("Decoded multisearch json response", "took", elapsed)
msr.status = res.StatusCode
msr.Status = res.StatusCode
return &msr, nil
}

View File

@@ -74,7 +74,7 @@ type MultiSearchRequest struct {
// MultiSearchResponse represents a multi search response
type MultiSearchResponse struct {
status int `json:"status,omitempty"`
Status int `json:"status,omitempty"`
Responses []*SearchResponse `json:"responses"`
}

View File

@@ -13,9 +13,6 @@ function exit_if_fail {
echo "running go fmt"
exit_if_fail test -z "$(gofmt -s -l ./pkg | tee /dev/stderr)"
echo "running go vet"
exit_if_fail test -z "$(go vet ./pkg/... | tee /dev/stderr)"
echo "building backend with install to cache pkgs"
exit_if_fail time go install ./pkg/cmd/grafana-server