chore: update Go, linter, CI
This commit is contained in:
@ -12,8 +12,8 @@ jobs:
|
|||||||
name: Main Process
|
name: Main Process
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
GO_VERSION: 1.17
|
GO_VERSION: 1.19
|
||||||
GOLANGCI_LINT_VERSION: v1.46.2
|
GOLANGCI_LINT_VERSION: v1.49.0
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
|
|
||||||
steps:
|
steps:
|
2
.github/workflows/go-cross.yml
vendored
2
.github/workflows/go-cross.yml
vendored
@ -15,7 +15,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [ 1.17, 1.x ]
|
go-version: [ 1.19, 1.x ]
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
name: Release Process
|
name: Release Process
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
GO_VERSION: 1.17
|
GO_VERSION: 1.19
|
||||||
SEIHON_VERSION: v0.9.0
|
SEIHON_VERSION: v0.9.0
|
||||||
CGO_ENABLED: 0
|
CGO_ENABLED: 0
|
||||||
|
|
||||||
|
@ -1,48 +1,93 @@
|
|||||||
run:
|
run:
|
||||||
deadline: 2m
|
timeout: 2m
|
||||||
skip-files: []
|
skip-files: []
|
||||||
|
|
||||||
linters-settings:
|
linters-settings:
|
||||||
govet:
|
govet:
|
||||||
check-shadowing: true
|
enable-all: true
|
||||||
|
disable:
|
||||||
|
- fieldalignment
|
||||||
gocyclo:
|
gocyclo:
|
||||||
min-complexity: 12
|
min-complexity: 16
|
||||||
goconst:
|
goconst:
|
||||||
min-len: 3
|
min-len: 3
|
||||||
min-occurrences: 3
|
min-occurrences: 3
|
||||||
misspell:
|
misspell:
|
||||||
locale: US
|
locale: US
|
||||||
|
funlen:
|
||||||
|
lines: -1
|
||||||
|
statements: 40
|
||||||
|
gofumpt:
|
||||||
|
extra-rules: true
|
||||||
|
depguard:
|
||||||
|
list-type: blacklist
|
||||||
|
include-go-root: false
|
||||||
|
packages:
|
||||||
|
- github.com/pkg/errors
|
||||||
|
godox:
|
||||||
|
keywords:
|
||||||
|
- FIXME
|
||||||
|
gocritic:
|
||||||
|
enabled-tags:
|
||||||
|
- diagnostic
|
||||||
|
- style
|
||||||
|
- performance
|
||||||
|
disabled-checks:
|
||||||
|
- sloppyReassign
|
||||||
|
- rangeValCopy
|
||||||
|
- octalLiteral
|
||||||
|
- paramTypeCombine # already handle by gofumpt.extra-rules
|
||||||
|
settings:
|
||||||
|
hugeParam:
|
||||||
|
sizeThreshold: 100
|
||||||
|
forbidigo:
|
||||||
|
forbid:
|
||||||
|
- '^print(ln)?$'
|
||||||
|
- '^panic$'
|
||||||
|
- '^spew\.Print(f|ln)?$'
|
||||||
|
- '^spew\.Dump$'
|
||||||
|
|
||||||
linters:
|
linters:
|
||||||
enable-all: true
|
enable-all: true
|
||||||
disable:
|
disable:
|
||||||
|
- deadcode # deprecated
|
||||||
|
- exhaustivestruct # deprecated
|
||||||
- golint # deprecated
|
- golint # deprecated
|
||||||
- scopelint # deprecated
|
- ifshort # deprecated
|
||||||
- interfacer # deprecated
|
- interfacer # deprecated
|
||||||
- maligned # deprecated
|
- maligned # deprecated
|
||||||
- lll
|
- nosnakecase # deprecated
|
||||||
- gosec
|
- scopelint # deprecated
|
||||||
|
- scopelint # deprecated
|
||||||
|
- structcheck # deprecated
|
||||||
|
- varcheck # deprecated
|
||||||
|
- execinquery # not relevant (SQL)
|
||||||
|
- rowserrcheck # not relevant (SQL)
|
||||||
|
- sqlclosecheck # not relevant (SQL)
|
||||||
|
- cyclop # duplicate of gocyclo
|
||||||
- dupl
|
- dupl
|
||||||
- prealloc
|
- exhaustive
|
||||||
|
- exhaustruct
|
||||||
|
- forbidigo
|
||||||
- gochecknoglobals
|
- gochecknoglobals
|
||||||
- gochecknoinits
|
- gochecknoinits
|
||||||
- gomnd
|
|
||||||
- wsl
|
|
||||||
- nlreturn
|
|
||||||
- testpackage
|
|
||||||
- paralleltest
|
|
||||||
- tparallel
|
|
||||||
- goerr113
|
- goerr113
|
||||||
- wrapcheck
|
- gomnd
|
||||||
- exhaustive
|
- gosec
|
||||||
- exhaustivestruct
|
- lll
|
||||||
- forbidigo
|
|
||||||
- varnamelen
|
|
||||||
- nilnil
|
- nilnil
|
||||||
- ifshort
|
- nlreturn
|
||||||
- exhaustruct
|
- paralleltest
|
||||||
|
- prealloc
|
||||||
|
- testpackage
|
||||||
|
- tparallel
|
||||||
|
- varnamelen
|
||||||
|
- wrapcheck
|
||||||
|
- wsl
|
||||||
|
|
||||||
issues:
|
issues:
|
||||||
exclude-use-default: false
|
exclude-use-default: false
|
||||||
max-per-linter: 0
|
max-per-linter: 0
|
||||||
max-same-issues: 0
|
max-same-issues: 0
|
||||||
exclude: []
|
exclude:
|
||||||
|
- 'package-comments: should have a package comment'
|
||||||
|
2
Makefile
2
Makefile
@ -1,4 +1,4 @@
|
|||||||
.PHONY: default build image check publish-images
|
.PHONY: default check test build image publish-images
|
||||||
|
|
||||||
TAG_NAME := $(shell git tag -l --contains HEAD)
|
TAG_NAME := $(shell git tag -l --contains HEAD)
|
||||||
|
|
||||||
|
5
app.go
5
app.go
@ -7,7 +7,6 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -85,7 +84,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setupMutualTLS(ca string) *tls.Config {
|
func setupMutualTLS(ca string) *tls.Config {
|
||||||
clientCACert, err := ioutil.ReadFile(ca)
|
clientCACert, err := os.ReadFile(ca)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
@ -312,7 +311,7 @@ func healthHandler(w http.ResponseWriter, req *http.Request) {
|
|||||||
|
|
||||||
func getEnv(key, fallback string) string {
|
func getEnv(key, fallback string) string {
|
||||||
value := os.Getenv(key)
|
value := os.Getenv(key)
|
||||||
if len(value) == 0 {
|
if value == "" {
|
||||||
return fallback
|
return fallback
|
||||||
}
|
}
|
||||||
return value
|
return value
|
||||||
|
Reference in New Issue
Block a user