Skip to content

Commit

Permalink
Update deps, fix lint, fix mount example (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
vearutop committed Mar 1, 2024
1 parent 2ccfa52 commit 340cf4a
Show file tree
Hide file tree
Showing 39 changed files with 361 additions and 218 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
GO111MODULE: "on"
CACHE_BENCHMARK: "off" # Enables benchmark result reuse between runs, may skew latency results.
RUN_BASE_BENCHMARK: "on" # Runs benchmark for PR base in case benchmark result is missing.
GO_VERSION: 1.21.x
GO_VERSION: 1.22.x
jobs:
bench:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
go-version: 1.22.x
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v3.7.0
uses: golangci/golangci-lint-action@v4.0.0
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.54.1
version: v1.56.2

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gorelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ concurrency:
cancel-in-progress: true

env:
GO_VERSION: 1.21.x
GO_VERSION: 1.22.x
jobs:
gorelease:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ concurrency:
env:
GO111MODULE: "on"
RUN_BASE_COVERAGE: "on" # Runs test for PR base in case base test coverage is missing.
COV_GO_VERSION: 1.21.x # Version of Go to collect coverage
COV_GO_VERSION: 1.22.x # Version of Go to collect coverage
TARGET_DELTA_COV: 90 # Target coverage of changed lines, in percents
jobs:
test:
strategy:
matrix:
go-version: [ 1.13.x, 1.20.x, 1.21.x ]
go-version: [ 1.13.x, 1.21.x, 1.22.x ]
runs-on: ubuntu-latest
steps:
- name: Install Go stable
Expand Down Expand Up @@ -88,9 +88,9 @@ jobs:
id: annotate
if: matrix.go-version == env.COV_GO_VERSION && github.event.pull_request.base.sha != ''
run: |
curl -sLO https://github.com/vearutop/gocovdiff/releases/download/v1.4.0/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && rm linux_amd64.tar.gz
curl -sLO https://github.com/vearutop/gocovdiff/releases/download/v1.4.2/linux_amd64.tar.gz && tar xf linux_amd64.tar.gz && rm linux_amd64.tar.gz
gocovdiff_hash=$(git hash-object ./gocovdiff)
[ "$gocovdiff_hash" == "f191b45548bb65ec2c7d88909679a57116ff1ba1" ] || (echo "::error::unexpected hash for gocovdiff, possible tampering: $gocovdiff_hash" && exit 1)
[ "$gocovdiff_hash" == "c37862c73a677e5a9c069470287823ab5bbf0244" ] || (echo "::error::unexpected hash for gocovdiff, possible tampering: $gocovdiff_hash" && exit 1)
git fetch origin master ${{ github.event.pull_request.base.sha }}
REP=$(./gocovdiff -mod github.com/$GITHUB_REPOSITORY -cov unit.coverprofile -gha-annotations gha-unit.txt -delta-cov-file delta-cov-unit.txt -target-delta-cov ${TARGET_DELTA_COV})
echo "${REP}"
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@ issues:
- linters:
- errcheck # Error checking omitted for brevity.
- gosec
- revive
path: "example_"

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#GOLANGCI_LINT_VERSION := "v1.54.1" # Optional configuration to pinpoint golangci-lint version.
#GOLANGCI_LINT_VERSION := "v1.56.2" # Optional configuration to pinpoint golangci-lint version.

# The head of Makefile determines location of dev-go to include standard targets.
GO ?= go
Expand Down
8 changes: 4 additions & 4 deletions _examples/advanced-generic-openapi31/_testdata/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -915,17 +915,17 @@
"simple":{"description":"Simple scalar value in body.","type":"string"},
"uploads1":{
"description":"Uploads with *multipart.FileHeader.",
"items":{"$ref":"#/components/schemas/MultipartFileHeader"},"type":["array","null"]
"items":{"$ref":"#/components/schemas/MultipartFileHeader"},"type":"array"
},
"uploads2":{
"description":"Uploads with multipart.File.","items":{"$ref":"#/components/schemas/MultipartFile"},
"type":["array","null"]
"type":"array"
}
},
"type":"object"
},
"MultipartFile":{"format":"binary","type":["null","string"]},
"MultipartFileHeader":{"format":"binary","type":["null","string"]},
"MultipartFile":{"contentMediaType":"application/octet-stream","format":"binary","type":"string"},
"MultipartFileHeader":{"contentMediaType":"application/octet-stream","format":"binary","type":"string"},
"RestErrResponse":{
"properties":{
"code":{"description":"Application-specific error code.","type":"integer"},
Expand Down
7 changes: 3 additions & 4 deletions _examples/advanced/_testdata/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -728,17 +728,16 @@
"simple":{"type":"string","description":"Simple scalar value in body."},
"uploads1":{
"type":"array","items":{"$ref":"#/components/schemas/MultipartFileHeader"},
"description":"Uploads with *multipart.FileHeader.","nullable":true
"description":"Uploads with *multipart.FileHeader."
},
"uploads2":{
"type":"array","items":{"$ref":"#/components/schemas/MultipartFile"},
"description":"Uploads with multipart.File.","nullable":true
"description":"Uploads with multipart.File."
}
},
"additionalProperties":false
},
"MultipartFile":{"type":"string","format":"binary","nullable":true},
"MultipartFileHeader":{"type":"string","format":"binary","nullable":true},
"MultipartFile":{"type":"string","format":"binary"},"MultipartFileHeader":{"type":"string","format":"binary"},
"RestErrResponse":{
"type":"object",
"properties":{
Expand Down
38 changes: 19 additions & 19 deletions _examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ replace github.com/swaggest/rest => ../

require (
github.com/bool64/ctxd v1.2.1
github.com/bool64/dev v0.2.32
github.com/bool64/dev v0.2.34
github.com/bool64/httpmock v0.1.13
github.com/bool64/httptestbench v0.1.4
github.com/gin-gonic/gin v1.9.1
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/jwtauth/v5 v5.1.1
github.com/google/uuid v1.3.0
github.com/go-chi/chi/v5 v5.0.12
github.com/go-chi/jwtauth/v5 v5.3.0
github.com/google/uuid v1.6.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/rs/cors v1.9.0
github.com/stretchr/testify v1.8.4
github.com/rs/cors v1.10.1
github.com/stretchr/testify v1.9.0
github.com/swaggest/assertjson v1.9.0
github.com/swaggest/jsonschema-go v0.3.64
github.com/swaggest/openapi-go v0.2.43
github.com/swaggest/jsonschema-go v0.3.66
github.com/swaggest/openapi-go v0.2.46
github.com/swaggest/rest v0.0.0-00010101000000-000000000000
github.com/swaggest/swgui v1.7.3
github.com/swaggest/usecase v1.3.0
github.com/valyala/fasthttp v1.48.0
github.com/swaggest/swgui v1.8.0
github.com/swaggest/usecase v1.3.1
github.com/valyala/fasthttp v1.52.0
)

require (
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/bool64/shared v0.1.5 // indirect
github.com/bytedance/sonic v1.9.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -42,14 +42,14 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/iancoleman/orderedmap v0.3.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.16.7 // indirect
github.com/klauspost/compress v1.17.7 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.4 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.11 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.20 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
Expand All @@ -70,10 +70,10 @@ require (
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading

0 comments on commit 340cf4a

Please sign in to comment.