Skip to content

Commit

Permalink
feat: update project to use golang 1.17.x (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
allisson committed Oct 2, 2021
1 parent 3eee16b commit 93092fa
Show file tree
Hide file tree
Showing 9 changed files with 454 additions and 111 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Expand Up @@ -24,10 +24,10 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand All @@ -48,7 +48,8 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: -E gosec
skip-pkg-cache: true
skip-build-cache: true

- name: Run Tests
env:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/verify.yml
Expand Up @@ -25,10 +25,10 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- name: Set up Go 1.16
- name: Set up Go 1.17
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
id: go

- name: Check out code into the Go module directory
Expand All @@ -49,7 +49,8 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
version: latest
args: -E gosec
skip-pkg-cache: true
skip-build-cache: true

- name: Run Tests
env:
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
@@ -0,0 +1,6 @@
linters:
enable:
- gosec
- rowserrcheck
- sqlclosecheck
- ifshort
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,5 +1,5 @@
#### development stage
FROM golang:1.16-buster AS builder
FROM golang:1.17-buster AS builder

# set envvar
ENV CGO_ENABLED=0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -3,7 +3,7 @@ PLATFORM := $(shell uname | tr A-Z a-z)
lint:
if [ ! -f ./bin/golangci-lint ] ; \
then \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.39.0; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.42.1; \
fi;
./bin/golangci-lint run

Expand Down
14 changes: 10 additions & 4 deletions docs/docs.go
@@ -1,22 +1,21 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag

package docs

import (
"bytes"
"encoding/json"
"strings"
"text/template"

"github.com/alecthomas/template"
"github.com/swaggo/swag"
)

var doc = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{.Description}}",
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"version": "{{.Version}}"
Expand Down Expand Up @@ -816,6 +815,13 @@ func (s *s) ReadDoc() string {
a, _ := json.Marshal(v)
return string(a)
},
"escape": func(v interface{}) string {
// escape tabs
str := strings.Replace(v.(string), "\t", "\\t", -1)
// replace " with \", and if that results in \\", replace that with \\\"
str = strings.Replace(str, "\"", "\\\"", -1)
return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
},
}).Parse(doc)
if err != nil {
return doc
Expand Down
58 changes: 44 additions & 14 deletions go.mod
@@ -1,25 +1,55 @@
module github.com/allisson/postmand

go 1.16
go 1.17

require (
github.com/DATA-DOG/go-txdb v0.1.4
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/allisson/go-env v0.3.0
github.com/go-chi/chi/v5 v5.0.2
github.com/go-chi/chi/v5 v5.0.4
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/golang-migrate/migrate/v4 v4.14.1
github.com/google/uuid v1.2.0
github.com/huandu/go-sqlbuilder v1.12.1
github.com/jmoiron/sqlx v1.3.3
github.com/joho/godotenv v1.3.0
github.com/golang-migrate/migrate/v4 v4.15.0
github.com/google/uuid v1.3.0
github.com/huandu/go-sqlbuilder v1.13.0
github.com/jmoiron/sqlx v1.3.4
github.com/joho/godotenv v1.4.0
github.com/jpillora/backoff v1.0.0
github.com/lib/pq v1.10.1
github.com/steinfletcher/apitest v1.5.4
github.com/lib/pq v1.10.3
github.com/steinfletcher/apitest v1.5.11
github.com/stretchr/testify v1.7.0
github.com/swaggo/http-swagger v1.0.0
github.com/swaggo/swag v1.7.0
github.com/unrolled/secure v1.0.8
github.com/swaggo/http-swagger v1.1.1
github.com/swaggo/swag v1.7.3
github.com/unrolled/secure v1.0.9
github.com/urfave/cli/v2 v2.3.0
go.uber.org/zap v1.16.0
go.uber.org/zap v1.19.1
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.19.5 // indirect
github.com/go-openapi/spec v0.20.3 // indirect
github.com/go-openapi/swag v0.19.14 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.0.1 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/tools v0.1.5 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

0 comments on commit 93092fa

Please sign in to comment.