Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ Server
<code>generate</code> flag to enable code generation
</th>
<th>
Required Go Version
</th>
<th>
Example usage
</th>
</tr>
Expand All @@ -437,6 +440,9 @@ Example usage
<code>chi-server</code>
</td>
<td>
1.22+
</td>
<td>


For a Chi server, you will want a configuration file such as:
Expand Down Expand Up @@ -465,6 +471,9 @@ To implement this, check out [the Chi docs](#impl-chi).
<code>echo-server</code>
</td>
<td>
1.22+
</td>
<td>

For an Echo server, you will want a configuration file such as:

Expand All @@ -491,7 +500,9 @@ To implement this, check out [the Echo docs](#impl-echo).
<td>
<code>fiber-server</code>
</td>

<td>
1.24+
</td>
<td>

For a Fiber server, you will want a configuration file such as:
Expand Down Expand Up @@ -521,6 +532,9 @@ To implement this, check out [the Fiber docs](#impl-fiber).
<code>gin-server</code>
</td>
<td>
1.22+
</td>
<td>

For a Gin server, you will want a configuration file such as:

Expand Down Expand Up @@ -548,7 +562,9 @@ To implement this, check out [the Gin docs](#impl-gin).
<td>
<code>gorilla-server</code>
</td>

<td>
1.22+
</td>
<td>

For a gorilla/mux server, you will want a configuration file such as:
Expand Down Expand Up @@ -576,7 +592,9 @@ To implement this, check out [the gorilla/mux docs](#impl-gorillamux).
<td>
<code>iris-server</code>
</td>

<td>
1.22+
</td>
<td>

For a Iris server, you will want a configuration file such as:
Expand Down Expand Up @@ -604,7 +622,9 @@ To implement this, check out [the Iris docs](#impl-iris).
<td>
<code>std-http-server</code>
</td>

<td>
1.22+
</td>
<td>

To use purely `net/http` (for Go 1.22+), you will want a configuration file such as:
Expand Down
31 changes: 6 additions & 25 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
SHELL:=/bin/bash

YELLOW := \e[0;33m
RESET := \e[0;0m

GOVER := $(shell go env GOVERSION)
GOMINOR := $(shell bash -c "cut -f1 -d' ' <<< \"$(GOVER)\" | cut -f2 -d.")

define execute-if-go-124
@{ \
if [[ 24 -le $(GOMINOR) ]]; then \
$1; \
else \
echo -e "$(YELLOW)Skipping task as you're running Go v1.$(GOMINOR).x which is < Go 1.24, which this module requires$(RESET)"; \
fi \
}
endef

lint:
$(call execute-if-go-124,$(GOBIN)/golangci-lint run ./...)
$(GOBIN)/golangci-lint run ./...

lint-ci:

$(call execute-if-go-124,$(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m)
$(GOBIN)/golangci-lint run ./... --output.text.path=stdout --timeout=5m

generate:
$(call execute-if-go-124,go generate ./...)
go generate ./...

test:
$(call execute-if-go-124,go test -cover ./...)
go test -cover ./...

tidy:
$(call execute-if-go-124,go mod tidy)
go mod tidy

tidy-ci:
$(call execute-if-go-124,tidied -verbose)
tidied -verbose
27 changes: 11 additions & 16 deletions examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
module github.com/oapi-codegen/oapi-codegen/v2/examples

go 1.24.0
go 1.22.5

replace github.com/oapi-codegen/oapi-codegen/v2 => ../

require (
github.com/getkin/kin-openapi v0.133.0
github.com/gin-gonic/gin v1.10.0
github.com/go-chi/chi/v5 v5.0.10
github.com/gofiber/fiber/v2 v2.52.11
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/kataras/iris/v12 v12.2.6-0.20230908161203-24ba4e8933b9
github.com/labstack/echo/v4 v4.12.0
github.com/lestrrat-go/jwx v1.2.26
github.com/oapi-codegen/echo-middleware v1.0.2
github.com/oapi-codegen/fiber-middleware v1.0.2
github.com/oapi-codegen/gin-middleware v1.0.2
github.com/oapi-codegen/iris-middleware v1.0.5
github.com/oapi-codegen/nethttp-middleware v1.0.2
Expand All @@ -32,12 +30,11 @@ require (
github.com/CloudyKit/jet/v6 v6.2.0 // indirect
github.com/Joker/jade v1.1.3 // indirect
github.com/Shopify/goreferrer v0.0.0-20220729165902-8cddb4f5de06 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/andybalholm/brotli v1.1.0 // indirect
github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/bytedance/sonic v1.11.6 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.6.0 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down Expand Up @@ -65,7 +62,7 @@ require (
github.com/kataras/pio v0.0.12 // indirect
github.com/kataras/sitemap v0.0.6 // indirect
github.com/kataras/tunnel v0.0.4 // indirect
github.com/klauspost/compress v1.18.4 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/labstack/gommon v0.4.2 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
Expand All @@ -76,9 +73,8 @@ require (
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/mailgun/raymond/v2 v2.0.48 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.19 // indirect
github.com/microcosm-cc/bluemonday v1.0.25 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
Expand All @@ -99,22 +95,21 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.69.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
github.com/woodsbury/decimal128 v1.3.0 // indirect
github.com/yosssi/ace v0.0.5 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/mod v0.30.0 // indirect
golang.org/x/net v0.48.0 // indirect
golang.org/x/sync v0.19.0 // indirect
golang.org/x/sys v0.41.0 // indirect
golang.org/x/text v0.32.0 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sync v0.11.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/text v0.22.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.39.0 // indirect
golang.org/x/tools v0.30.0 // indirect
google.golang.org/protobuf v1.34.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading