Skip to content

Commit e972184

Browse files
authored
Releases/v7.22.0 (#137)
1 parent 6da001b commit e972184

File tree

167 files changed

+14059
-839
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+14059
-839
lines changed

.github/workflows/ci-test.yml

Lines changed: 72 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,27 @@ jobs:
99
security-events: write
1010
steps:
1111
- name: Checkout repo
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313
with:
1414
path: src/github.com/qiniu/go-sdk
1515
ref: ${{ github.ref }}
1616
submodules: recursive
1717
- name: Install Go
18-
uses: actions/setup-go@v2
18+
uses: actions/setup-go@v5
1919
with:
20-
go-version: '1.10.x'
20+
go-version: '1.10'
2121
- name: Run unit cases
2222
run: |
23-
set -e
23+
set -ex
2424
rm -rf $GITHUB_WORKSPACE/src/github.com/qiniu/x && git clone -b v1.12.21 --depth 1 https://github.com/qiniu/x.git $GITHUB_WORKSPACE/src/github.com/qiniu/x
25-
GOPATH=$GITHUB_WORKSPACE go get golang.org/x/sync/singleflight
25+
2626
GOPATH=$GITHUB_WORKSPACE go get github.com/qiniu/dyn
27-
GOPATH=$GITHUB_WORKSPACE go get github.com/gofrs/flock
27+
28+
rm -rf $GITHUB_WORKSPACE/src/github.com/gofrs/flock && git clone -b v0.8.1 --depth 1 https://github.com/gofrs/flock $GITHUB_WORKSPACE/src/github.com/gofrs/flock
29+
2830
GOPATH=$GITHUB_WORKSPACE go get github.com/alex-ant/gomath/rational
29-
GOPATH=$GITHUB_WORKSPACE go get github.com/matishsiao/goInfo
31+
GOPATH=$GITHUB_WORKSPACE go get github.com/gammazero/toposort
32+
GOPATH=$GITHUB_WORKSPACE go get github.com/joeshaw/multierror
3033
3134
# FIXME special package
3235
# github.com/go-playground/validator/v10
@@ -35,18 +38,21 @@ jobs:
3538
# new package name don't work in non-module mode
3639
rm -rf $GITHUB_WORKSPACE/src/github.com/go-playground/validator/v10 && git clone -b v10.9.0 --depth 1 https://github.com/go-playground/validator.git $GITHUB_WORKSPACE/src/github.com/go-playground/validator/v10
3740
rm -rf $GITHUB_WORKSPACE/src/github.com/universal-translator && git clone -b v0.18.0 --depth 1 https://github.com/go-playground/universal-translator.git $GITHUB_WORKSPACE/src/github.com/go-playground/universal-translator
38-
41+
rm -rf $GITHUB_WORKSPACE/src/github.com/elastic/go-sysinfo && git clone -b v1.0.2 --depth 1 https://github.com/elastic/go-sysinfo.git $GITHUB_WORKSPACE/src/github.com/elastic/go-sysinfo
42+
rm -rf $GITHUB_WORKSPACE/src/github.com/pkg/errors && git clone -b v0.9.1 --depth 1 https://github.com/pkg/errors.git $GITHUB_WORKSPACE/src/github.com/pkg/errors
43+
rm -rf $GITHUB_WORKSPACE/src/github.com/prometheus/procfs && git clone -b v0.0.6 --depth 1 https://github.com/prometheus/procfs.git $GITHUB_WORKSPACE/src/github.com/prometheus/procfs
44+
rm -rf $GITHUB_WORKSPACE/src/howett.net/plist && git clone -b v1.0.0 --depth 1 https://github.com/DHowett/go-plist.git $GITHUB_WORKSPACE/src/howett.net/plist
45+
rm -rf $GITHUB_WORKSPACE/src/golang.org/x/sys && git clone -b v0.13.0 --depth 1 https://github.com/golang/sys $GITHUB_WORKSPACE/src/golang.org/x/sys
3946
rm -rf $GITHUB_WORKSPACE/src/golang.org/x/crypto && git clone -b v0.10.0 --depth 1 https://go.googlesource.com/crypto $GITHUB_WORKSPACE/src/golang.org/x/crypto
40-
# GOPATH=$GITHUB_WORKSPACE go get golang.org/x/crypto/sha3
41-
4247
rm -rf $GITHUB_WORKSPACE/src/golang.org/x/text && git clone -b v0.10.0 --depth 1 https://github.com/golang/text $GITHUB_WORKSPACE/src/golang.org/x/text
43-
# GOPATH=$GITHUB_WORKSPACE go get golang.org/x/text/language
48+
rm -rf $GITHUB_WORKSPACE/src/golang.org/x/sync && git clone -b v0.3.0 --depth 1 https://github.com/golang/sync $GITHUB_WORKSPACE/src/golang.org/x/sync
4449
4550
GOPATH=$GITHUB_WORKSPACE go get github.com/leodido/go-urn
4651
GOPATH=$GITHUB_WORKSPACE go get github.com/go-playground/locales
4752
4853
rm -rf $GITHUB_WORKSPACE/src/github.com/dave/jennifer && git clone -b v1.6.1 --depth 1 https://github.com/dave/jennifer $GITHUB_WORKSPACE/src/github.com/dave/jennifer
49-
# GOPATH=$GITHUB_WORKSPACE go get github.com/dave/jennifer
54+
rm -rf $GITHUB_WORKSPACE/src/modernc.org/fileutil && git clone -b v1.0.0 --depth 1 https://gitlab.com/cznic/fileutil.git $GITHUB_WORKSPACE/src/modernc.org/fileutil
55+
rm -rf $GITHUB_WORKSPACE/src/github.com/gorilla/mux && git clone -b v1.7.4 --depth 1 https://github.com/gorilla/mux $GITHUB_WORKSPACE/src/github.com/gorilla/mux
5056
5157
GOPATH=$GITHUB_WORKSPACE go get github.com/iancoleman/strcase
5258
@@ -66,39 +72,88 @@ jobs:
6672
fail-fast: false
6773
max-parallel: 1
6874
matrix:
69-
go_version: ['1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x', '1.17.x', '1.18.x', '1.19.x', '1.20.x', '1.21.x', '1.22.x']
75+
go_version: ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20', '1.21', '1.22']
7076
runs-on: ubuntu-latest
7177
permissions:
7278
actions: read
7379
contents: read
7480
security-events: write
7581
steps:
7682
- name: Checkout repo
77-
uses: actions/checkout@v2
83+
uses: actions/checkout@v4
7884
with:
7985
ref: ${{ github.ref }}
8086
submodules: recursive
8187
- name: Install Go
82-
uses: actions/setup-go@v2
88+
uses: actions/setup-go@v5
8389
with:
8490
go-version: ${{ matrix.go_version }}
8591
- name: Format
8692
run: |
87-
if [ "${{ matrix.go_version }}" = "1.22.x" ]; then
93+
if [ "${{ matrix.go_version }}" = "1.22" ]; then
8894
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
8995
exit 1
9096
fi
9197
fi
9298
- name: Golint
9399
run: |
94-
if [ "${{ matrix.go_version }}" = "1.22.x" ]; then
100+
if [ "${{ matrix.go_version }}" = "1.22" ]; then
95101
set -e
96102
go install honnef.co/go/tools/cmd/staticcheck@latest
97103
make staticcheck
98104
fi
99105
- name: Run unit cases
100106
run: |
101107
set -e
108+
if [ "${{ matrix.go_version }}" = "1.11" ] || [ "${{ matrix.go_version }}" = "1.12" ] || [ "${{ matrix.go_version }}" = "1.13" ] || [ "${{ matrix.go_version }}" = "1.14" ] || [ "${{ matrix.go_version }}" = "1.15" ]; then
109+
go get modernc.org/fileutil@v1.0.0
110+
fi
102111
make unittest
103112
env:
104113
GO111MODULE: 'on'
114+
go-mod-test-windows:
115+
needs: 'go-mod-test'
116+
runs-on: windows-latest
117+
permissions:
118+
actions: read
119+
contents: read
120+
security-events: write
121+
steps:
122+
- name: Checkout repo
123+
uses: actions/checkout@v4
124+
with:
125+
ref: ${{ github.ref }}
126+
submodules: recursive
127+
- name: Install Go
128+
uses: actions/setup-go@v5
129+
with:
130+
go-version: stable
131+
- name: Run unit cases
132+
run: |
133+
set -e
134+
make unittest
135+
shell: bash
136+
go-mod-test-macos:
137+
needs: 'go-mod-test-windows'
138+
runs-on: macos-latest
139+
permissions:
140+
actions: read
141+
contents: read
142+
security-events: write
143+
steps:
144+
- name: Checkout repo
145+
uses: actions/checkout@v4
146+
with:
147+
ref: ${{ github.ref }}
148+
submodules: recursive
149+
- name: Install Go
150+
uses: actions/setup-go@v5
151+
with:
152+
go-version: stable
153+
- name: Install dependencies
154+
run: |
155+
brew install make
156+
- name: Run unit cases
157+
run: |
158+
set -e
159+
make unittest

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ integrationtest:
88
go test -tags=integration -failfast -parallel 1 -v -coverprofile=coverage.txt `go list ./... | egrep -v 'examples|sms'`
99

1010
staticcheck:
11-
staticcheck -go 1.10 `go list ./... | egrep -v 'examples|sms'`
11+
staticcheck `go list ./... | egrep -v 'examples|sms'`
1212

1313
generate:
1414
go generate ./storagev2/

api-specs

client/dialer.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ func defaultDialFunc(ctx context.Context, network string, address string) (net.C
3131
keepAliveInterval = 15 * time.Second
3232
}
3333
if resolved, ok := ctx.Value(resolverContextKey{}).(resolverContextValue); ok && len(resolved.ips) > 0 && resolved.domain == host {
34-
dialer := net.Dialer{Timeout: dialTimeout / time.Duration(len(resolved.ips)), KeepAlive: keepAliveInterval}
34+
dialTimeout = dialTimeout / time.Duration(len(resolved.ips))
35+
if dialTimeout < 3*time.Second {
36+
dialTimeout = 3 * time.Second
37+
}
38+
dialer := net.Dialer{Timeout: dialTimeout, KeepAlive: keepAliveInterval}
3539
for _, ip := range resolved.ips {
3640
newAddr := ip.String()
3741
if port != "" {

go.mod

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@ require (
66
github.com/BurntSushi/toml v1.3.2
77
github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82
88
github.com/dave/jennifer v1.6.1
9-
github.com/davecgh/go-spew v1.1.1 // indirect
9+
github.com/elastic/go-sysinfo v1.0.2 // indirect
10+
github.com/gammazero/toposort v0.1.1 // indirect
1011
github.com/go-playground/universal-translator v0.18.0 // indirect
11-
github.com/go-playground/validator/v10 v10.8.0
12+
github.com/go-playground/validator/v10 v10.7.0
1213
github.com/gofrs/flock v0.8.1
14+
github.com/gorilla/mux v1.8.1 // indirect
1315
github.com/iancoleman/strcase v0.3.0
1416
github.com/kr/pretty v0.3.0 // indirect
17+
github.com/leodido/go-urn v1.2.1 // indirect
1518
github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f
1619
github.com/qiniu/dyn v1.3.0
1720
github.com/rogpeppe/go-internal v1.8.0 // indirect
1821
github.com/stretchr/testify v1.6.1
19-
golang.org/x/crypto v0.1.0 // indirect
22+
github.com/yuin/goldmark v1.4.13 // indirect
23+
golang.org/x/mod v0.6.0-dev // indirect
2024
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
21-
golang.org/x/sys v0.12.0 // indirect
25+
golang.org/x/sys v0.0.0-20190425145619-16072639606e // indirect
26+
golang.org/x/text v0.3.7 // indirect
2227
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
2328
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
29+
modernc.org/fileutil v1.3.0
2430
)

0 commit comments

Comments
 (0)