Skip to content

Commit 5780006

Browse files
authored
chore: use http-swagger/v2 for go:embed to reduce binary size (coder#6897)
I'm testing how much this will reduce the size, but it should be by a few MB!
1 parent afcc179 commit 5780006

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

coderd/coderd.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323
"github.com/klauspost/compress/zstd"
2424
"github.com/moby/moby/pkg/namesgenerator"
2525
"github.com/prometheus/client_golang/prometheus"
26-
httpSwagger "github.com/swaggo/http-swagger"
26+
httpSwagger "github.com/swaggo/http-swagger/v2"
2727
"go.opentelemetry.io/otel/trace"
2828
"golang.org/x/xerrors"
2929
"google.golang.org/api/idtoken"

go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ require (
130130
github.com/spf13/afero v1.9.3
131131
github.com/spf13/pflag v1.0.5
132132
github.com/stretchr/testify v1.8.1
133-
github.com/swaggo/http-swagger v1.3.3
133+
github.com/swaggo/http-swagger/v2 v2.0.1
134134
github.com/swaggo/swag v1.8.6
135135
github.com/tabbed/pqtype v0.1.1
136136
github.com/u-root/u-root v0.11.0
@@ -186,6 +186,7 @@ require (
186186
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
187187
github.com/modern-go/reflect2 v1.0.2 // indirect
188188
github.com/muesli/cancelreader v0.2.2 // indirect
189+
github.com/swaggo/files/v2 v2.0.0 // indirect
189190
golang.org/x/text v0.8.0 // indirect
190191
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230215201556-9c5414ab4bde // indirect
191192
)
@@ -311,7 +312,6 @@ require (
311312
github.com/sirupsen/logrus v1.9.0 // indirect
312313
github.com/spf13/cast v1.5.0 // indirect
313314
github.com/spf13/jwalterweatherman v1.1.0 // indirect
314-
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe // indirect
315315
github.com/tadvi/systray v0.0.0-20190226123456-11a2b8fa57af // indirect
316316
github.com/tailscale/certstore v0.1.1-0.20220316223106-78d6e1c49d8d // indirect
317317
github.com/tailscale/golang-x-crypto v0.0.0-20221102133106-bc99ab8c2d17 // indirect

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -1803,10 +1803,10 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
18031803
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
18041804
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
18051805
github.com/swaggest/assertjson v1.7.0 h1:SKw5Rn0LQs6UvmGrIdaKQbMR1R3ncXm5KNon+QJ7jtw=
1806-
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc=
1807-
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w=
1808-
github.com/swaggo/http-swagger v1.3.3 h1:Hu5Z0L9ssyBLofaama21iYaF2VbWyA8jdohaaCGpHsc=
1809-
github.com/swaggo/http-swagger v1.3.3/go.mod h1:sE+4PjD89IxMPm77FnkDz0sdO+p5lbXzrVWT6OTVVGo=
1806+
github.com/swaggo/files/v2 v2.0.0 h1:hmAt8Dkynw7Ssz46F6pn8ok6YmGZqHSVLZ+HQM7i0kw=
1807+
github.com/swaggo/files/v2 v2.0.0/go.mod h1:24kk2Y9NYEJ5lHuCra6iVwkMjIekMCaFq/0JQj66kyM=
1808+
github.com/swaggo/http-swagger/v2 v2.0.1 h1:mNOBLxDjSNwCKlMxcErjjvct/xhc9t2KIO48xzz/V/k=
1809+
github.com/swaggo/http-swagger/v2 v2.0.1/go.mod h1:XYhrQVIKz13CxuKD4p4kvpaRB4jJ1/MlfQXVOE+CX8Y=
18101810
github.com/swaggo/swag v1.8.6 h1:2rgOaLbonWu1PLP6G+/rYjSvPg0jQE0HtrEKuE380eg=
18111811
github.com/swaggo/swag v1.8.6/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg=
18121812
github.com/sylvia7788/contextcheck v1.0.4/go.mod h1:vuPKJMQ7MQ91ZTqfdyreNKwZjyUg6KO+IebVyQDedZQ=

0 commit comments

Comments
 (0)