diff --git a/.circleci/config.yml b/.circleci/config.yml index 7499579..b8dca0e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2 jobs: go-version-latest: docker: - - image: cimg/go:1.19-node + - image: cimg/go:1.20-node resource_class: large steps: - checkout @@ -10,7 +10,7 @@ jobs: - run: make alltest go-version-last: docker: - - image: cimg/go:1.18-node + - image: cimg/go:1.19-node resource_class: large steps: - checkout diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index c9051f3..0aa1c5d 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -16,13 +16,13 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: '1.20' - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.49.0 + version: v1.51 # Optional: golangci-lint command line arguments. # args: --issues-exit-code=0 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index d0234d5..484167a 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -15,7 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.19 + go-version: '1.20' - name: Make All run: | diff --git a/.golangci.yml b/.golangci.yml index 39c8e3f..0fe5d72 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,5 @@ service: - # When updating this, also update the version stored in docker/build-tools/Dockerfile in the istio/tools repo. - golangci-lint-version: 1.49.x # use the fixed version to not introduce new linters unexpectedly + golangci-lint-version: 1.51.x # use the fixed version to not introduce new linters unexpectedly run: concurrency: 4 @@ -127,6 +126,11 @@ issues: - errcheck - maligned + # keep it until we only support go1.20 + - linters: + - staticcheck + text: "SA1019: rand.Seed has been deprecated" + # Independently from option `exclude` we use default exclude patterns, # it can be disabled by this option. To list all # excluded by default patterns execute `golangci-lint run --help`. diff --git a/client/service.go b/client/service.go index c8d92c6..90d5b3a 100644 --- a/client/service.go +++ b/client/service.go @@ -19,7 +19,6 @@ import ( "crypto/tls" "fmt" "io" - "math/rand" "net" "runtime" "strconv" @@ -47,7 +46,6 @@ import ( func init() { crypto.DefaultSalt = "frp" - rand.Seed(time.Now().UnixNano()) } // Service is a client service. diff --git a/cmd/frps/main.go b/cmd/frps/main.go index 56477aa..a7c1e9b 100644 --- a/cmd/frps/main.go +++ b/cmd/frps/main.go @@ -15,9 +15,6 @@ package main import ( - "math/rand" - "time" - "github.com/fatedier/golib/crypto" _ "github.com/fatedier/frp/assets/frps" @@ -26,7 +23,6 @@ import ( func main() { crypto.DefaultSalt = "frp" - rand.Seed(time.Now().UnixNano()) Execute() } diff --git a/dockerfiles/Dockerfile-for-frpc b/dockerfiles/Dockerfile-for-frpc index b749be0..96a3d8b 100644 --- a/dockerfiles/Dockerfile-for-frpc +++ b/dockerfiles/Dockerfile-for-frpc @@ -1,4 +1,4 @@ -FROM golang:1.19 AS building +FROM golang:1.20 AS building COPY . /building WORKDIR /building diff --git a/dockerfiles/Dockerfile-for-frps b/dockerfiles/Dockerfile-for-frps index cd71612..12d5201 100644 --- a/dockerfiles/Dockerfile-for-frps +++ b/dockerfiles/Dockerfile-for-frps @@ -1,4 +1,4 @@ -FROM golang:1.19 AS building +FROM golang:1.20 AS building COPY . /building WORKDIR /building diff --git a/go.mod b/go.mod index 386aedb..dd63184 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/fatedier/frp -go 1.19 +go 1.20 require ( github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5