Skip to content

Commit

Permalink
security updates needs at least go version >=1.17 (#15)
Browse files Browse the repository at this point in the history
[Dependabot alert fix] - Unhandled exception in gopkg.in/yaml.v3 #1
- update `go.mod` go version up to `1.18`
- update direct and indirect dependencies
PS: during the first steps of this update, tests using go version <1.17 fails because of their dependencies requirements.
  • Loading branch information
gritzkoo committed Jun 1, 2022
1 parent f8746cd commit f2b7780
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 79 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ indent_style = tab
[*.md]
trim_trailing_whitespace = false

[*.go]
[*.{go,mod,sum}]
indent_style = tab
indent_size = 4

6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
redis-version: [4, 5, 6]
go: ["1.14", "1.15", "1.16", "1.17", "1.18"]
redis-version: [6]
go: ["1.17", "1.18"]
steps:
- uses: actions/checkout@v2
- name: Sets up a Memcached server
Expand Down Expand Up @@ -48,4 +48,4 @@ jobs:
steps:
- uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: minor
bump_version_scheme: patch
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ services:
- memcached

go:
- 1.14.x
- 1.15.x
- 1.17.x
- 1.18.x
- tip

matrix:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.15
FROM golang:1.18-alpine

WORKDIR /go/src/app
COPY . .
Expand Down
26 changes: 13 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,27 @@ version: "3.7"

services:
test:
&default
container_name: golang_app
build:
context: .
command: go test ./...
image: golang:1.18-alpine
working_dir: /app
command: sh -c "go test -v ./..."
environment:
- CGO_ENABLED=0
- GOOS=linux
volumes:
- .:/go/src/app
- .:/app
- godir:/go
ports:
- 8888:8888
depends_on:
- redis
- memcache

app:
<<: *default
container_name: golang_app
build:
context: .
command: go run main.go
volumes:
- .:/go/src/app
ports:
- 8888:8888
depends_on:
- redis
- memcache

redis:
image: redis
Expand All @@ -40,3 +37,6 @@ services:
networks:
default:
name: gritzkoo-golang-health-checker

volumes:
godir: {}
28 changes: 20 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
module github.com/gritzkoo/golang-health-checker

go 1.16
go 1.18

require (
github.com/bradfitz/gomemcache v0.0.0-20220106215444-fb4bf637b56d
github.com/gin-gonic/gin v1.7.7
github.com/go-playground/validator/v10 v10.11.0 // indirect
github.com/gin-gonic/gin v1.8.0
github.com/go-redis/redis v6.15.9+incompatible
github.com/golang/protobuf v1.5.2 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
gopkg.in/go-playground/assert.v1 v1.2.1
)

require (
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-playground/locales v0.14.0 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.11.0 // indirect
github.com/goccy/go-json v0.9.7 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/stretchr/testify v1.7.1 // indirect
github.com/ugorji/go v1.2.7 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
github.com/onsi/gomega v1.19.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
github.com/ugorji/go/codec v1.2.7 // indirect
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit f2b7780

Please sign in to comment.