Skip to content

Commit 261ab7e

Browse files
authored
Merge pull request #188 from partyoffice/feature/go-122
Feature/go 122
2 parents f3828d2 + e09f9b1 commit 261ab7e

File tree

6 files changed

+151
-686
lines changed

6 files changed

+151
-686
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- name: Set up Go
1515
uses: actions/setup-go@v2
1616
with:
17-
go-version: 1.17
17+
go-version: 1.22
1818

1919
- name: Check formatting
2020
run: go fmt ./... && git diff --exit-code

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.18 AS builder
1+
FROM golang:1.22 AS builder
22

33
WORKDIR /go/src/github.com/partyoffice/spotifete
44
COPY . .

authentication/cookie.go

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
package authentication
22

33
import (
4-
"errors"
5-
"net/http"
6-
7-
"github.com/getsentry/sentry-go"
84
"github.com/gin-gonic/gin"
9-
"github.com/google/logger"
105
"github.com/partyoffice/spotifete/database/model"
116
)
127

@@ -30,14 +25,7 @@ func GetValidSessionFromCookie(c *gin.Context) *model.LoginSession {
3025

3126
func GetSessionIdFromCookie(c *gin.Context) *string {
3227
sessionId, err := c.Cookie(sessionCookieName)
33-
if err != nil {
34-
if !errors.As(err, &http.ErrNoCookie) {
35-
logger.Error("Could not get error from context", err)
36-
sentry.CaptureException(err)
37-
}
38-
39-
return nil
40-
} else if sessionId == "" {
28+
if err != nil || sessionId == "" {
4129
return nil
4230
}
4331

go.mod

+37-36
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,71 @@
11
module github.com/partyoffice/spotifete
22

3-
go 1.18
3+
go 1.22
44

55
require (
6-
github.com/getsentry/sentry-go v0.20.0
7-
github.com/gin-contrib/cors v1.4.0
8-
github.com/gin-gonic/gin v1.9.0
9-
github.com/golang-migrate/migrate/v4 v4.16.2
6+
github.com/getsentry/sentry-go v0.27.0
7+
github.com/gin-contrib/cors v1.6.0
8+
github.com/gin-gonic/gin v1.9.1
9+
github.com/golang-migrate/migrate/v4 v4.17.0
1010
github.com/google/logger v1.1.1
1111
github.com/patrickmn/go-cache v2.1.0+incompatible
1212
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
13-
github.com/spf13/viper v1.16.0
13+
github.com/spf13/viper v1.18.2
1414
github.com/zmb3/spotify v1.3.0
15-
golang.org/x/oauth2 v0.13.0
16-
gorm.io/driver/postgres v1.4.5
17-
gorm.io/gorm v1.25.3
15+
golang.org/x/oauth2 v0.18.0
16+
gorm.io/driver/postgres v1.5.7
17+
gorm.io/gorm v1.25.7
1818
)
1919

2020
require (
21-
github.com/bytedance/sonic v1.8.0 // indirect
22-
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
23-
github.com/fsnotify/fsnotify v1.6.0 // indirect
21+
github.com/bytedance/sonic v1.11.2 // indirect
22+
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
23+
github.com/chenzhuoyu/iasm v0.9.1 // indirect
24+
github.com/fsnotify/fsnotify v1.7.0 // indirect
25+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
2426
github.com/gin-contrib/sse v0.1.0 // indirect
2527
github.com/go-playground/locales v0.14.1 // indirect
2628
github.com/go-playground/universal-translator v0.18.1 // indirect
27-
github.com/go-playground/validator/v10 v10.11.2 // indirect
28-
github.com/goccy/go-json v0.10.0 // indirect
29+
github.com/go-playground/validator/v10 v10.19.0 // indirect
30+
github.com/goccy/go-json v0.10.2 // indirect
2931
github.com/golang/protobuf v1.5.3 // indirect
3032
github.com/hashicorp/errwrap v1.1.0 // indirect
3133
github.com/hashicorp/go-multierror v1.1.1 // indirect
3234
github.com/hashicorp/hcl v1.0.0 // indirect
33-
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
34-
github.com/jackc/pgconn v1.14.0 // indirect
35-
github.com/jackc/pgio v1.0.0 // indirect
3635
github.com/jackc/pgpassfile v1.0.0 // indirect
37-
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
3836
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
39-
github.com/jackc/pgtype v1.14.0 // indirect
40-
github.com/jackc/pgx/v4 v4.18.1 // indirect
37+
github.com/jackc/pgx/v5 v5.4.3 // indirect
4138
github.com/jinzhu/inflection v1.0.0 // indirect
4239
github.com/jinzhu/now v1.1.5 // indirect
4340
github.com/json-iterator/go v1.1.12 // indirect
44-
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
45-
github.com/leodido/go-urn v1.2.1 // indirect
46-
github.com/lib/pq v1.10.2 // indirect
41+
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
42+
github.com/leodido/go-urn v1.4.0 // indirect
43+
github.com/lib/pq v1.10.9 // indirect
4744
github.com/magiconair/properties v1.8.7 // indirect
48-
github.com/mattn/go-isatty v0.0.17 // indirect
45+
github.com/mattn/go-isatty v0.0.20 // indirect
4946
github.com/mitchellh/mapstructure v1.5.0 // indirect
5047
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5148
github.com/modern-go/reflect2 v1.0.2 // indirect
52-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
53-
github.com/spf13/afero v1.9.5 // indirect
54-
github.com/spf13/cast v1.5.1 // indirect
55-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
49+
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
50+
github.com/sagikazarmark/locafero v0.4.0 // indirect
51+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
52+
github.com/sourcegraph/conc v0.3.0 // indirect
53+
github.com/spf13/afero v1.11.0 // indirect
54+
github.com/spf13/cast v1.6.0 // indirect
5655
github.com/spf13/pflag v1.0.5 // indirect
57-
github.com/subosito/gotenv v1.4.2 // indirect
56+
github.com/subosito/gotenv v1.6.0 // indirect
5857
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
59-
github.com/ugorji/go/codec v1.2.9 // indirect
58+
github.com/ugorji/go/codec v1.2.12 // indirect
6059
go.uber.org/atomic v1.9.0 // indirect
61-
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
62-
golang.org/x/crypto v0.14.0 // indirect
63-
golang.org/x/net v0.17.0 // indirect
64-
golang.org/x/sys v0.13.0 // indirect
65-
golang.org/x/text v0.13.0 // indirect
60+
go.uber.org/multierr v1.9.0 // indirect
61+
golang.org/x/arch v0.7.0 // indirect
62+
golang.org/x/crypto v0.21.0 // indirect
63+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
64+
golang.org/x/net v0.22.0 // indirect
65+
golang.org/x/sys v0.18.0 // indirect
66+
golang.org/x/text v0.14.0 // indirect
6667
google.golang.org/appengine v1.6.7 // indirect
67-
google.golang.org/protobuf v1.31.0 // indirect
68+
google.golang.org/protobuf v1.33.0 // indirect
6869
gopkg.in/ini.v1 v1.67.0 // indirect
6970
gopkg.in/yaml.v3 v3.0.1 // indirect
7071
)

0 commit comments

Comments
 (0)