Skip to content

Commit

Permalink
chore: upgrade go to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
Muchogoc committed Mar 3, 2023
1 parent e16e140 commit 8c7d8f2
Show file tree
Hide file tree
Showing 15 changed files with 200 additions and 938 deletions.
66 changes: 27 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,27 @@ env:


jobs:
golangci:
strategy:
matrix:
go-version: [1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest

lint_and_test:
needs: [golangci]
strategy:
matrix:
go-version: [1.17.x]
go-version: [1.19.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 80
Expand All @@ -43,52 +60,23 @@ jobs:
project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
export_default_credentials: true

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Install Go dependencies
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1
go get -u github.com/kisielk/errcheck
go get -u golang.org/x/lint/golint
go install honnef.co/go/tools/cmd/staticcheck@2021.1.2
go get -u github.com/axw/gocov/gocov
go get -u github.com/securego/gosec/cmd/gosec
go get -u github.com/ory/go-acc
go get -u github.com/client9/misspell/cmd/misspell
go get -u github.com/gordonklaus/ineffassign
go get github.com/fzipp/gocyclo
go get github.com/stretchr/testify/assert@v1.7.0
go mod download
go get github.com/axw/gocov/gocov
go get github.com/ory/go-acc
go get golang.org/x/oauth2/internal
go get google.golang.org/api/transport/http
go get -d github.com/99designs/gqlgen@v0.17.24
go get google.golang.org/grpc
go get google.golang.org/grpc/internal/transport
go get cloud.google.com/go/monitoring/apiv3/v2
go get cloud.google.com/go/trace/apiv2
go get cloud.google.com/go/errorreporting
go get cloud.google.com/go/profiler
go get cloud.google.com/go/storage
go get firebase.google.com/go/storage@v3.13.0+incompatible
go get github.com/tj/assert
go get golang.org/x/sys/unix
go get cloud.google.com/go/firestore@v1.9.0
go get cloud.google.com/go/logging/apiv2@v1.6.1
go get cloud.google.com/go/logging/apiv2@v1.6.1
go get google.golang.org/genproto/googleapis/longrunning@v0.0.0-20230112194545-e10362b5ecf9
- name: Run lint and test
run: |
staticcheck ./...
go fmt $(go list ./... | grep -v /vendor/)
go vet $(go list ./... | grep -v /vendor/)
golint -set_exit_status $(go list ./... | grep -v /vendor/)
errcheck -ignore 'os:.*,' $(go list ./... | grep -v /vendor/)
misspell -error .
gosec -exclude=G304,G101 ./...
go install github.com/ory/go-acc
go install github.com/axw/gocov/gocov
- name: Run tests
run: |
go-acc -o coverage.txt --ignore generated,cmd ./... -- -timeout 60m
grep -v "generated.go" coverage.txt | grep -v "_gen.go" | grep -v "_mock.go" | grep -v "*mock.go" | grep -v "mocks.go" | grep -v "*resolver*go" | grep -v "server.go" > coverage.out
go tool cover -html=coverage.out -o coverage.html
Expand Down
25 changes: 25 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# Options for analysis running.
run:
timeout: 2m
tests: false
skip-dirs:
- pkg/clinical/presentation/graph/

linters:
enable:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- typecheck
- unused
- gosec
- misspell
- revive
- funlen
- gofmt

linters-settings:
staticcheck:
checks: ["all"]
funlen:
lines: -1
statements: -1

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Use the official Golang image to create a build artifact.
# This is based on Debian and sets the GOPATH to /go.
# https://hub.docker.com/_/golang
FROM golang:1.16 as builder
FROM golang:1.19 as builder

# Create and change to the app directory.
WORKDIR /app
Expand Down
98 changes: 76 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
module github.com/savannahghi/clinical

go 1.16
go 1.19

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/firestore v1.9.0
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/longrunning v0.4.1 // indirect
cloud.google.com/go/monitoring v1.12.0 // indirect
cloud.google.com/go/profiler v0.3.1 // indirect
cloud.google.com/go/pubsub v1.28.0
cloud.google.com/go/storage v1.29.0 // indirect
cloud.google.com/go/trace v1.8.0 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.13.11 // indirect
github.com/99designs/gqlgen v0.17.24
github.com/ahmetb/go-linq/v3 v3.2.0
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/aws/aws-sdk-go v1.44.208 // indirect
github.com/brianvoe/gofakeit v3.18.0+incompatible
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/getsentry/sentry-go v0.18.0
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/pprof v0.0.0-20230222194610-99052d3372e7 // indirect
github.com/google/uuid v1.3.0
github.com/gorilla/handlers v1.5.1
github.com/gorilla/mux v1.8.0
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/imroc/req v0.3.2
github.com/labstack/gommon v0.4.0
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mitchellh/mapstructure v1.5.0
github.com/rs/xid v1.4.0
github.com/savannahghi/authutils v0.0.7
Expand All @@ -45,19 +29,89 @@ require (
github.com/savannahghi/scalarutils v0.0.4
github.com/savannahghi/serverutils v0.0.7
github.com/segmentio/ksuid v1.0.4
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.1
github.com/tj/assert v0.0.3
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vektah/gqlparser/v2 v2.5.1
golang.org/x/oauth2 v0.5.0
google.golang.org/api v0.110.0
gopkg.in/yaml.v2 v2.4.0
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.18.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/errorreporting v0.3.0 // indirect
cloud.google.com/go/iam v0.12.0 // indirect
cloud.google.com/go/logging v1.6.1 // indirect
cloud.google.com/go/longrunning v0.4.1 // indirect
cloud.google.com/go/monitoring v1.12.0 // indirect
cloud.google.com/go/profiler v0.3.1 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
cloud.google.com/go/trace v1.8.0 // indirect
contrib.go.opencensus.io/exporter/stackdriver v0.13.11 // indirect
firebase.google.com/go v3.13.0+incompatible // indirect
github.com/agnivade/levenshtein v1.1.1 // indirect
github.com/aws/aws-sdk-go v1.44.208 // indirect
github.com/census-instrumentation/opencensus-proto v0.4.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator v9.31.0+incompatible // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230222194610-99052d3372e7 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/golang-lru v0.6.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lithammer/shortuuid v3.0.0+incompatible // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect
github.com/ttacon/builder v0.0.0-20170518171403-c099f663e1c2 // indirect
github.com/ttacon/libphonenumber v1.2.1 // indirect
github.com/urfave/cli/v2 v2.8.1 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib v1.14.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.21.0 // indirect
go.opentelemetry.io/otel v1.13.0 // indirect
go.opentelemetry.io/otel/exporters/jaeger v1.13.0 // indirect
golang.org/x/oauth2 v0.5.0
go.opentelemetry.io/otel/internal/metric v0.21.0 // indirect
go.opentelemetry.io/otel/metric v0.21.0 // indirect
go.opentelemetry.io/otel/sdk v1.13.0 // indirect
go.opentelemetry.io/otel/trace v1.13.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/api v0.110.0
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230223222841-637eb2293923 // indirect
gopkg.in/yaml.v2 v2.4.0
google.golang.org/grpc v1.53.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
moul.io/http2curl v1.0.0 // indirect
)
Loading

0 comments on commit 8c7d8f2

Please sign in to comment.