Skip to content

Commit

Permalink
Releases/v7.22.0 (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
bachue authored Sep 3, 2024
1 parent 6da001b commit e972184
Show file tree
Hide file tree
Showing 167 changed files with 14,059 additions and 839 deletions.
89 changes: 72 additions & 17 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,27 @@ jobs:
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: src/github.com/qiniu/go-sdk
ref: ${{ github.ref }}
submodules: recursive
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: '1.10.x'
go-version: '1.10'
- name: Run unit cases
run: |
set -e
set -ex
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
GOPATH=$GITHUB_WORKSPACE go get golang.org/x/sync/singleflight
GOPATH=$GITHUB_WORKSPACE go get github.com/qiniu/dyn
GOPATH=$GITHUB_WORKSPACE go get github.com/gofrs/flock
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
GOPATH=$GITHUB_WORKSPACE go get github.com/alex-ant/gomath/rational
GOPATH=$GITHUB_WORKSPACE go get github.com/matishsiao/goInfo
GOPATH=$GITHUB_WORKSPACE go get github.com/gammazero/toposort
GOPATH=$GITHUB_WORKSPACE go get github.com/joeshaw/multierror
# FIXME special package
# github.com/go-playground/validator/v10
Expand All @@ -35,18 +38,21 @@ jobs:
# new package name don't work in non-module mode
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
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
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
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
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
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
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
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
# GOPATH=$GITHUB_WORKSPACE go get golang.org/x/crypto/sha3
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
# GOPATH=$GITHUB_WORKSPACE go get golang.org/x/text/language
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
GOPATH=$GITHUB_WORKSPACE go get github.com/leodido/go-urn
GOPATH=$GITHUB_WORKSPACE go get github.com/go-playground/locales
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
# GOPATH=$GITHUB_WORKSPACE go get github.com/dave/jennifer
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
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
GOPATH=$GITHUB_WORKSPACE go get github.com/iancoleman/strcase
Expand All @@ -66,39 +72,88 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
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']
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']
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: recursive
- name: Install Go
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go_version }}
- name: Format
run: |
if [ "${{ matrix.go_version }}" = "1.22.x" ]; then
if [ "${{ matrix.go_version }}" = "1.22" ]; then
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
exit 1
fi
fi
- name: Golint
run: |
if [ "${{ matrix.go_version }}" = "1.22.x" ]; then
if [ "${{ matrix.go_version }}" = "1.22" ]; then
set -e
go install honnef.co/go/tools/cmd/staticcheck@latest
make staticcheck
fi
- name: Run unit cases
run: |
set -e
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
go get modernc.org/[email protected]
fi
make unittest
env:
GO111MODULE: 'on'
go-mod-test-windows:
needs: 'go-mod-test'
runs-on: windows-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: recursive
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run unit cases
run: |
set -e
make unittest
shell: bash
go-mod-test-macos:
needs: 'go-mod-test-windows'
runs-on: macos-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: recursive
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Install dependencies
run: |
brew install make
- name: Run unit cases
run: |
set -e
make unittest
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ integrationtest:
go test -tags=integration -failfast -parallel 1 -v -coverprofile=coverage.txt `go list ./... | egrep -v 'examples|sms'`

staticcheck:
staticcheck -go 1.10 `go list ./... | egrep -v 'examples|sms'`
staticcheck `go list ./... | egrep -v 'examples|sms'`

generate:
go generate ./storagev2/
2 changes: 1 addition & 1 deletion api-specs
6 changes: 5 additions & 1 deletion client/dialer.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ func defaultDialFunc(ctx context.Context, network string, address string) (net.C
keepAliveInterval = 15 * time.Second
}
if resolved, ok := ctx.Value(resolverContextKey{}).(resolverContextValue); ok && len(resolved.ips) > 0 && resolved.domain == host {
dialer := net.Dialer{Timeout: dialTimeout / time.Duration(len(resolved.ips)), KeepAlive: keepAliveInterval}
dialTimeout = dialTimeout / time.Duration(len(resolved.ips))
if dialTimeout < 3*time.Second {
dialTimeout = 3 * time.Second
}
dialer := net.Dialer{Timeout: dialTimeout, KeepAlive: keepAliveInterval}
for _, ip := range resolved.ips {
newAddr := ip.String()
if port != "" {
Expand Down
14 changes: 10 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,25 @@ require (
github.com/BurntSushi/toml v1.3.2
github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82
github.com/dave/jennifer v1.6.1
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/elastic/go-sysinfo v1.0.2 // indirect
github.com/gammazero/toposort v0.1.1 // indirect
github.com/go-playground/universal-translator v0.18.0 // indirect
github.com/go-playground/validator/v10 v10.8.0
github.com/go-playground/validator/v10 v10.7.0
github.com/gofrs/flock v0.8.1
github.com/gorilla/mux v1.8.1 // indirect
github.com/iancoleman/strcase v0.3.0
github.com/kr/pretty v0.3.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/matishsiao/goInfo v0.0.0-20210923090445-da2e3fa8d45f
github.com/qiniu/dyn v1.3.0
github.com/rogpeppe/go-internal v1.8.0 // indirect
github.com/stretchr/testify v1.6.1
golang.org/x/crypto v0.1.0 // indirect
github.com/yuin/goldmark v1.4.13 // indirect
golang.org/x/mod v0.6.0-dev // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4
golang.org/x/sys v0.12.0 // indirect
golang.org/x/sys v0.0.0-20190425145619-16072639606e // indirect
golang.org/x/text v0.3.7 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
modernc.org/fileutil v1.3.0
)
Loading

0 comments on commit e972184

Please sign in to comment.