Skip to content

Commit 7e2d631

Browse files
committed
update go, use go:embed
1 parent 492770b commit 7e2d631

File tree

4 files changed

+46
-41
lines changed

4 files changed

+46
-41
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.13-alpine
1+
FROM golang:1.20-alpine
22

33
WORKDIR /go/src/github.com/ccbrown/gggtracker
44

go.mod

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
11
module github.com/ccbrown/gggtracker
22

3-
go 1.13
3+
go 1.20
44

55
require (
66
github.com/PuerkitoBio/goquery v1.3.0
7-
github.com/andybalholm/cascadia v1.0.0
87
github.com/aws/aws-lambda-go v1.7.0
98
github.com/aws/aws-sdk-go-v2 v0.16.0
109
github.com/boltdb/bolt v1.3.1
11-
github.com/davecgh/go-spew v1.1.1
12-
github.com/dgrijalva/jwt-go v3.1.0+incompatible
13-
github.com/fsnotify/fsnotify v1.4.7
14-
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb
15-
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af
1610
github.com/json-iterator/go v1.1.5
17-
github.com/kevinburke/go-bindata v3.23.0+incompatible // indirect
1811
github.com/labstack/echo v3.2.6+incompatible
19-
github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0
20-
github.com/magiconair/properties v1.7.6
21-
github.com/mattn/go-colorable v0.0.9
22-
github.com/mattn/go-isatty v0.0.3
23-
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238
24-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd
25-
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742
26-
github.com/pelletier/go-toml v1.1.0
2712
github.com/pkg/errors v0.8.0
28-
github.com/pmezard/go-difflib v1.0.0
2913
github.com/sirupsen/logrus v1.0.4
30-
github.com/spf13/afero v1.0.2
31-
github.com/spf13/cast v1.2.0
32-
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec
3314
github.com/spf13/pflag v1.0.0
3415
github.com/spf13/viper v1.0.0
3516
github.com/stretchr/testify v1.2.2
36-
github.com/valyala/bytebufferpool v1.0.0
37-
github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4
3817
golang.org/x/crypto v0.0.0-20180228161326-91a49db82a88
39-
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc
4018
golang.org/x/sys v0.0.0-20180302081741-dd2ff4accc09
41-
golang.org/x/text v0.3.0
42-
gopkg.in/yaml.v2 v2.1.1
19+
)
20+
21+
require (
22+
github.com/BurntSushi/toml v1.3.2 // indirect
23+
github.com/andybalholm/cascadia v1.0.0 // indirect
24+
github.com/davecgh/go-spew v1.1.1 // indirect
25+
github.com/dgrijalva/jwt-go v3.1.0+incompatible // indirect
26+
github.com/fsnotify/fsnotify v1.4.7 // indirect
27+
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect
28+
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
29+
github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0 // indirect
30+
github.com/magiconair/properties v1.7.6 // indirect
31+
github.com/mattn/go-colorable v0.0.9 // indirect
32+
github.com/mattn/go-isatty v0.0.3 // indirect
33+
github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 // indirect
34+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
35+
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 // indirect
36+
github.com/pelletier/go-toml v1.1.0 // indirect
37+
github.com/pmezard/go-difflib v1.0.0 // indirect
38+
github.com/spf13/afero v1.0.2 // indirect
39+
github.com/spf13/cast v1.2.0 // indirect
40+
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec // indirect
41+
github.com/valyala/bytebufferpool v1.0.0 // indirect
42+
github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 // indirect
43+
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc // indirect
44+
golang.org/x/text v0.3.0 // indirect
45+
gopkg.in/airbrake/gobrake.v2 v2.0.9 // indirect
46+
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 // indirect
47+
gopkg.in/yaml.v2 v2.1.1 // indirect
4348
)

go.sum

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
2+
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
13
github.com/PuerkitoBio/goquery v1.3.0 h1:2LzdaeRwZjIMW7iKEei51jiCPB33mou4AI7QCzS4NgE=
24
github.com/PuerkitoBio/goquery v1.3.0/go.mod h1:T9ezsOHcCrDCgA8aF1Cqr3sSYbO/xgdy8/R/XiIMAhA=
35
github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o=
@@ -8,7 +10,6 @@ github.com/aws/aws-sdk-go-v2 v0.16.0 h1:X5pkFnjRNdDEX18NwDGWMaWL5ocNQX0qIYEhEcsT
810
github.com/aws/aws-sdk-go-v2 v0.16.0/go.mod h1:pFLIN9LDjOEwHfruGweAXEq0XaD6uRkY8FsRkxhuBIg=
911
github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=
1012
github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps=
11-
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1213
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1314
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1415
github.com/dgrijalva/jwt-go v3.1.0+incompatible h1:FFziAwDQQ2dz1XClWMkwvukur3evtZx7x/wMHKM1i20=
@@ -20,17 +21,10 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
2021
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
2122
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb h1:1OvvPvZkn/yCQ3xBcM8y4020wdkMXPHLB4+NfoGWh4U=
2223
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w=
23-
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
2424
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM=
2525
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
2626
github.com/json-iterator/go v1.1.5 h1:gL2yXlmiIo4+t+y32d4WGwOjKGYcGOuyrg46vadswDE=
2727
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
28-
github.com/kevinburke/go-bindata v3.16.0+incompatible h1:TFzFZop2KxGhqNwsyjgmIh5JOrpG940MZlm5gNbxr8g=
29-
github.com/kevinburke/go-bindata v3.16.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
30-
github.com/kevinburke/go-bindata v3.21.0+incompatible h1:baK7hwFJDlAHrOqmE9U3u8tow1Uc5ihN9E/b7djcK2g=
31-
github.com/kevinburke/go-bindata v3.21.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
32-
github.com/kevinburke/go-bindata v3.23.0+incompatible h1:rqNOXZlqrYhMVVAsQx8wuc+LaA73YcfbQ407wAykyS8=
33-
github.com/kevinburke/go-bindata v3.23.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
3428
github.com/labstack/echo v3.2.6+incompatible h1:28U/uXFFKBIP+VQIqq641LuYhMS7Br9ZlwEXERaohCc=
3529
github.com/labstack/echo v3.2.6+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
3630
github.com/labstack/gommon v0.2.2-0.20170925052817-57409ada9da0 h1:7AIW1qc9sYYTZLamTsRKSmVvJDXkZZrIWXHDK4Gq4X0=
@@ -65,7 +59,6 @@ github.com/spf13/pflag v1.0.0 h1:oaPbdDe/x0UncahuwiPxW1GYJyilRAdsPnq3e1yaPcI=
6559
github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
6660
github.com/spf13/viper v1.0.0 h1:RUA/ghS2i64rlnn4ydTfblY8Og8QzcPtCcHvgMn+w/I=
6761
github.com/spf13/viper v1.0.0/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM=
68-
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
6962
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
7063
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
7164
github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
@@ -75,8 +68,6 @@ github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50w
7568
golang.org/x/crypto v0.0.0-20180228161326-91a49db82a88 h1:jLkAo/qlT9whgCLYC5GAJ9kcKrv3Wj8VCc4N+KJ4wpw=
7669
golang.org/x/crypto v0.0.0-20180228161326-91a49db82a88/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
7770
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
78-
golang.org/x/net v0.0.0-20180301190904-22ae77b79946 h1:Ovdd3aDjGOBx9xVuWVwMZWXbFQ3542Ve+TGnNVoE/Mc=
79-
golang.org/x/net v0.0.0-20180301190904-22ae77b79946/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
8071
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
8172
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc h1:a3CU5tJYVj92DY2LaA1kUkrsqD5/3mLDhx2NcNqyW+0=
8273
golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -85,6 +76,11 @@ golang.org/x/sys v0.0.0-20180302081741-dd2ff4accc09/go.mod h1:STP8DvDyc/dI5b8T5h
8576
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
8677
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
8778
google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
79+
gopkg.in/airbrake/gobrake.v2 v2.0.9 h1:7z2uVWwn7oVeeugY1DtlPAy5H+KYgB1KeKTnqjNatLo=
80+
gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U=
81+
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
8882
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
83+
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2 h1:OAj3g0cR6Dx/R07QgQe8wkA9RNjB2u4i700xBkIT4e0=
84+
gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo=
8985
gopkg.in/yaml.v2 v2.1.1 h1:fxK3tv8mQPVEgxu/S2LJ040LyqiajHt+syP0CdDS/Sc=
9086
gopkg.in/yaml.v2 v2.1.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

server/server.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//go:generate sh -c "go get -u github.com/kevinburke/go-bindata/... && `go env GOPATH`/bin/go-bindata -pkg server -ignore '(^|/)\\..*' static/..."
21
package server
32

43
import (
5-
"bytes"
4+
"embed"
5+
"io"
66
"net/http"
77
"net/url"
88
"path"
@@ -13,13 +13,17 @@ import (
1313
"github.com/labstack/echo/middleware"
1414
)
1515

16+
//go:embed static/*
17+
var static embed.FS
18+
1619
func serveAsset(c echo.Context, path string) error {
17-
b, err := Asset(path)
20+
f, err := static.Open(path)
1821
if err != nil {
1922
http.NotFound(c.Response(), c.Request())
2023
return nil
2124
}
22-
http.ServeContent(c.Response(), c.Request(), path, time.Time{}, bytes.NewReader(b))
25+
defer f.Close()
26+
http.ServeContent(c.Response(), c.Request(), path, time.Time{}, f.(io.ReadSeeker))
2327
return nil
2428
}
2529

0 commit comments

Comments
 (0)