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

Add go vet check to project #94

Merged
merged 2 commits into from
Dec 15, 2017
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
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ install:
- go get github.com/Masterminds/glide
- go get github.com/nats-io/nats-streaming-server
script:
- hack/verify-gofmt.sh
- hack/verify-govet.sh
- cd ${TRAVIS_BUILD_DIR}
- glide install
- ./build/build-linux.sh
- hack/verify-gofmt.sh
- test/runtests.sh
notifications:
slack:
Expand Down
8 changes: 4 additions & 4 deletions cmd/fission-workflows-bundle/bundle/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func Run(ctx context.Context, opts *Options) error {

// Http servers
if opts.Fission != nil {
proxySrv := http.Server{Addr: FISSION_PROXY_ADDRESS}
proxySrv := &http.Server{Addr: FISSION_PROXY_ADDRESS}
defer proxySrv.Shutdown(ctx)
runFissionEnvironmentProxy(proxySrv, es, wfiCache(), wfCache(), resolvers)
}
Expand Down Expand Up @@ -159,7 +159,7 @@ func Run(ctx context.Context, opts *Options) error {
}

if opts.ApiHttp {
apiSrv := http.Server{Addr: API_GATEWAY_ADDRESS}
apiSrv := &http.Server{Addr: API_GATEWAY_ADDRESS}
defer apiSrv.Shutdown(ctx)
var admin, wf, wfi string
if opts.ApiAdmin {
Expand Down Expand Up @@ -292,7 +292,7 @@ func runWorkflowInvocationApiServer(s *grpc.Server, es fes.EventStore, wfiCache
log.Infof("Serving workflow invocation gRPC API at %s.", GRPC_ADDRESS)
}

func runHttpGateway(ctx context.Context, gwSrv http.Server, adminApiAddr string, wfApiAddr string, wfiApiAddr string) {
func runHttpGateway(ctx context.Context, gwSrv *http.Server, adminApiAddr string, wfApiAddr string, wfiApiAddr string) {
mux := grpcruntime.NewServeMux()
grpcOpts := []grpc.DialOption{grpc.WithInsecure()}
if adminApiAddr != "" {
Expand Down Expand Up @@ -325,7 +325,7 @@ func runHttpGateway(ctx context.Context, gwSrv http.Server, adminApiAddr string,
log.Info("Serving HTTP API gateway at: ", gwSrv.Addr)
}

func runFissionEnvironmentProxy(proxySrv http.Server, es fes.EventStore, wfiCache fes.CacheReader,
func runFissionEnvironmentProxy(proxySrv *http.Server, es fes.EventStore, wfiCache fes.CacheReader,
wfCache fes.CacheReader, resolvers map[string]function.Resolver) {

workflowParser := parse.NewResolver(resolvers)
Expand Down
15 changes: 15 additions & 0 deletions hack/verify-govet.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -o errexit
set -o nounset
set -o pipefail

find_files() {
find . -not \( \
\( \
-wholename '*/vendor/*' \
\) -prune \
\) -name '*.go'
}

find_files | grep -v '.glide/cache' | xargs -I@ bash -c "go tool vet @"
2 changes: 1 addition & 1 deletion pkg/fes/eventstore/nats/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ func toEvent(msg *stan.Msg) (*fes.Event, error) {
return nil, err
}

e.Id = fmt.Sprintf("%s", msg.Sequence)
e.Id = fmt.Sprintf("%d", msg.Sequence)
return e, nil
}
2 changes: 1 addition & 1 deletion pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func CreateScopeId(parentId string, taskId string) string {
}

// Wait is a sync.WaitGroup.Wait() implementation that supports timeouts
func Wait(wg sync.WaitGroup, timeout time.Duration) bool {
func Wait(wg *sync.WaitGroup, timeout time.Duration) bool {
wgDone := make(chan bool)
defer close(wgDone)
go func() {
Expand Down