Skip to content

Commit

Permalink
support go1.20 (#3287)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier authored Feb 5, 2023
1 parent 6b3daff commit 100148d
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ version: 2
jobs:
go-version-latest:
docker:
- image: cimg/go:1.19-node
- image: cimg/go:1.20-node
resource_class: large
steps:
- checkout
- run: make
- run: make alltest
go-version-last:
docker:
- image: cimg/go:1.18-node
- image: cimg/go:1.19-node
resource_class: large
steps:
- checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
8 changes: 6 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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`.
Expand Down
2 changes: 0 additions & 2 deletions client/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"crypto/tls"
"fmt"
"io"
"math/rand"
"net"
"runtime"
"strconv"
Expand Down Expand Up @@ -47,7 +46,6 @@ import (

func init() {
crypto.DefaultSalt = "frp"
rand.Seed(time.Now().UnixNano())
}

// Service is a client service.
Expand Down
4 changes: 0 additions & 4 deletions cmd/frps/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
package main

import (
"math/rand"
"time"

"github.com/fatedier/golib/crypto"

_ "github.com/fatedier/frp/assets/frps"
Expand All @@ -26,7 +23,6 @@ import (

func main() {
crypto.DefaultSalt = "frp"
rand.Seed(time.Now().UnixNano())

Execute()
}
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile-for-frpc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19 AS building
FROM golang:1.20 AS building

COPY . /building
WORKDIR /building
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/Dockerfile-for-frps
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19 AS building
FROM golang:1.20 AS building

COPY . /building
WORKDIR /building
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 100148d

Please sign in to comment.