diff --git a/.circleci/config.yml b/.circleci/config.yml index 1a762c1412b..9aae18f7534 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,5 +16,5 @@ jobs: - run: go generate ./... && if [[ $(git --no-pager diff) ]] ; then echo "you need to run go generate" ; git --no-pager diff ; exit 1 ; fi - run: go vet ./... - run: go test -race ./... - - run: gometalinter ./example/... ./codegen/... ./handler/... + - run: gometalinter --vendor ./... diff --git a/client/websocket.go b/client/websocket.go index 8bd7382a0a8..555ddd5b9e6 100644 --- a/client/websocket.go +++ b/client/websocket.go @@ -10,16 +10,10 @@ import ( ) const ( - connectionInitMsg = "connection_init" // Client -> Server - connectionTerminateMsg = "connection_terminate" // Client -> Server - startMsg = "start" // Client -> Server - stopMsg = "stop" // Client -> Server - connectionAckMsg = "connection_ack" // Server -> Client - connectionErrorMsg = "connection_error" // Server -> Client - connectionKeepAliveMsg = "ka" // Server -> Client - dataMsg = "data" // Server -> Client - errorMsg = "error" // Server -> Client - completeMsg = "complete" // Server -> Client + connectionInitMsg = "connection_init" // Client -> Server + startMsg = "start" // Client -> Server + connectionAckMsg = "connection_ack" // Server -> Client + dataMsg = "data" // Server -> Client ) type operationMessage struct { @@ -62,7 +56,7 @@ func (p *Client) Websocket(query string, options ...Option) *Subscription { } var ack operationMessage - if err := c.ReadJSON(&ack); err != nil { + if err = c.ReadJSON(&ack); err != nil { return errorSubscription(fmt.Errorf("ack: %s", err.Error())) } if ack.Type != connectionAckMsg { @@ -90,7 +84,7 @@ func (p *Client) Websocket(query string, options ...Option) *Subscription { if respDataRaw["errors"] != nil { var errs []*errors.QueryError - if err := unpack(respDataRaw["errors"], errs); err != nil { + if err = unpack(respDataRaw["errors"], errs); err != nil { return err } if len(errs) > 0 { diff --git a/main.go b/main.go index a48a251bd2a..e7040b60416 100644 --- a/main.go +++ b/main.go @@ -63,13 +63,14 @@ func main() { } config.SchemaStr = string(schemaRaw) - if err := config.Check(); err != nil { + if err = config.Check(); err != nil { fmt.Fprintln(os.Stderr, "invalid config format: "+err.Error()) os.Exit(1) } if emitYamlGuidance { - b, err := yaml.Marshal(config) + var b []byte + b, err = yaml.Marshal(config) if err != nil { fmt.Fprintln(os.Stderr, "unable to marshal yaml: "+err.Error()) os.Exit(1)