Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Add golint
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Apr 21, 2019
1 parent 7af0661 commit 895d736
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
17 changes: 16 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
language: go

go:
- 1.11
- 1.12

env:
global:
- PATH=/home/travis/gopath/bin:$PATH
# docker credentials
- secure: "MMDlT13nZPkJRlC6qXXYoxNJrwxoXFyzxJsipZhEE0YGza1kq/8spej9QroYlh5LgpJbcIOV0FtrKWF+5NYSY/dsNF/apKZkdgpemh7pDez8R6vaGCLoXvAnd5HAkyHv/uzrxUYAK9NuKBc4utZLMmsZxmY1HFd3M357WX6X6JpxxESPtMb7mdY5OZFmqnaNlde6p8zoo9oJmiG6Q0t52nhNaSY82Y2kf06e32IfgJiRwDzideLyVU1TH1YcSRXstT3m8/xPJQWDRKUNurbKeJnPJE/iga/fGNjvMaEtLcbSCE9g4AgyaJEfPgHGDFNCUQ3G7iovN6URNdk2Q8EJCaT6ZKDZAarWaF2SmUrnTWl1RjrjwnU7Yvvx4ls9b8iCEXAitXaSXqnz5M+yDKf33bO5mX1B4Skv7kPAdC4bHWtgndAOyfcLqUKbHntcYh2pGX61TBw7qD1mSVx3nItmIEvqKuP2dEmNc9nBO3lBD4CSRvNpKT1vT3S1wX25pblWvz1bV28LKuSPU5GzusaI/KJ2mv+YC2CTJ287tQd7xZSEFYaS2NT5irysT4awcJLvYXm6L1t2rC3XUAGGuBFMbTMJzRPCSyzuLStt66C0i83iLHmNIuCIsi0Yp02nvDuR+L1n5kl7NgSP7cc0bxSNQbzpv4ncruEHApLndK1N3Nw="
- secure: "aFjBMVNpdvHKAMCrS0HUNLfytpIaq/QZfIO2zHctUKjRf5iw1ypmA7sqfKpsxuGJv0Z0jFUOOSH0qct9XtmESC0RRNeuSTaQoqKnxu6abAYm3DGf653C1/fAY4UN3yDxzjNzbVPickH2kTsgm/DDXvjwlsp6p70qnWQg4+ET2uqygT7jkoL+Hn51l+hOe5q/P/2gzd36PwVWXWsrCu9u9THVg44ghp3wB0lfkiaXcFq4bPjBJYWIGsTBUt+KQIxwhNPUiYgCH8Lv+A86U1SkROEAA+5kU3Wbr8Leq5XXzUbLAnqXPzYfvMAb6zdtkILwZv2yjzdUpyN5fXEoWrPkCMK6w2vPu1jIr0H4g8Dy6mTbj7ux4YWoLfbbhCU8r6/t0dpuzt+nRglgbIpKHnbGA3SVt1LBH4Cf6bGjO0jeyYi5V3m88jg8Ul+gmP6ZhkEs7YeRDjKpy6BGygoVYt9ZPvaw5nQI5j5mDH6ncdvZ/ZxNOlMUOVWPONoHGybXasW/lmdagXosO/mdwlFxhHhpts9WTxQV20p4Hc6QMK2xB31Pdg2KmwyTqRVe7d1T82PnWyozSKWSjJLZVGR2is1rnCrmRBV2UvOlePtsqoQT/IoWFQT/6yt8tLdcnj0l1c27nMcHQAZySw3c4MTqT8VKEKzosyLP7GE+kdktryuhvfk="
- COMMIT=${TRAVIS_COMMIT::8}

notifications:
email:
on_success: never
on_failure: change

before_install:
# Install linters and misspell
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | bash -s -- -b $GOPATH/bin v1.15.0
- golangci-lint --version

before_script:
- export GO111MODULE=on

script:
- go build -o gravo *.go

after_success:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export REPO=andig/gravo
Expand Down
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (api *Api) get(endpoint string) (io.Reader, error) {
}
defer resp.Body.Close() // close body after checking for error

duration := time.Now().Sub(start)
duration := time.Since(start)
log.Printf("GET %s (%dms)", url, duration.Nanoseconds()/1e6)

// read body
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
module github.com/andig/gravo

go 1.12
2 changes: 1 addition & 1 deletion handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func logger(f http.HandlerFunc, debug bool) http.HandlerFunc {

f(w, r)

duration := time.Now().Sub(start)
duration := time.Since(start)
log.Printf("%v %v (%dms)", r.Method, r.URL.Path, duration.Nanoseconds()/1e6)

if debug {
Expand Down

0 comments on commit 895d736

Please sign in to comment.