diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 83614a2..0909ed7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,8 +20,8 @@ jobs: cache: false - uses: actions/checkout@v3 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v8 with: version: latest - args: --sort-results --disable unused + args: --disable unused diff --git a/Dockerfile b/Dockerfile index de9efd8..de2be7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build container -FROM --platform=${BUILDPLATFORM} golang:1.24 AS builder +FROM --platform=${BUILDPLATFORM} golang:1.25 AS builder LABEL org.opencontainers.image.source=https://github.com/devcyclehq/sdk-proxy LABEL org.opencontainers.image.description="DevCycle SDK Proxy" LABEL org.opencontainers.image.licenses=MIT diff --git a/go.mod b/go.mod index 47d0721..20d0328 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/devcyclehq/sdk-proxy/v2 -go 1.24.0 +go 1.25.0 require ( github.com/devcyclehq/go-server-sdk/v2 v2.23.0 @@ -41,10 +41,10 @@ require ( github.com/ugorji/go/codec v1.3.0 // indirect go.uber.org/mock v0.5.2 // indirect golang.org/x/arch v0.19.0 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.54.0 // indirect + golang.org/x/net v0.57.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.40.0 // indirect google.golang.org/protobuf v1.36.6 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 412cbe2..1aaca7a 100644 --- a/go.sum +++ b/go.sum @@ -96,15 +96,15 @@ go.uber.org/mock v0.5.2 h1:LbtPTcP8A5k9WPXj54PPPbjcI4Y6lhyOZXn+VS7wNko= go.uber.org/mock v0.5.2/go.mod h1:wLlUxC2vVTPTaE3UD51E0BGOAElKrILxhVSDYQLld5o= golang.org/x/arch v0.19.0 h1:LmbDQUodHThXE+htjrnmVD73M//D9GTH6wFZjyDkjyU= golang.org/x/arch v0.19.0/go.mod h1:bdwinDaKcfZUGpH09BB7ZmOfhalA8lQdzl62l8gGWsk= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/crypto v0.54.0 h1:YLIA59K4fiNzHzjnZt2tUJQjQtUWfWbeHBqKtk3eScw= +golang.org/x/crypto v0.54.0/go.mod h1:KWL8ny2AZdGR2cWmzeHrp2azQPGogOv+HeQaVEXC2dk= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= +golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/http_endpoints.go b/http_endpoints.go index e35287d..207479a 100644 --- a/http_endpoints.go +++ b/http_endpoints.go @@ -100,7 +100,7 @@ func BatchEvents() gin.HandlerFunc { c.JSON(http.StatusInternalServerError, gin.H{"message": "Error reading request body: " + err.Error()}) return } - defer c.Request.Body.Close() + defer c.Request.Body.Close() //nolint:errcheck var batchEvents map[string]interface{} err = json.Unmarshal(body, &batchEvents) @@ -174,7 +174,7 @@ func BatchEvents() gin.HandlerFunc { c.JSON(http.StatusInternalServerError, gin.H{"message": "Error reading response: " + err.Error()}) return } - defer resp.Body.Close() + defer resp.Body.Close() //nolint:errcheck c.Data(resp.StatusCode, resp.Header.Get("Content-Type"), respBody) } } @@ -292,7 +292,7 @@ func getUserFromBody(c *gin.Context) *devcycle.User { }) return nil } - defer c.Request.Body.Close() + defer c.Request.Body.Close() //nolint:errcheck err = json.Unmarshal(jsonBody, &user) if err != nil { c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{ @@ -316,7 +316,7 @@ func getEventFromBody(c *gin.Context) *devcycle.UserDataAndEventsBody { }) return nil } - defer c.Request.Body.Close() + defer c.Request.Body.Close() //nolint:errcheck err = json.Unmarshal(jsonBody, &event) if err != nil { diff --git a/options.go b/options.go index 215ec69..04358d1 100644 --- a/options.go +++ b/options.go @@ -111,7 +111,7 @@ func (i *ProxyInstance) BypassSDKConfig(version string) (config []byte, etag, la } body, err := io.ReadAll(resp.Body) - defer resp.Body.Close() + defer resp.Body.Close() //nolint:errcheck if err != nil { return i.bypassConfig, "", "" } @@ -230,7 +230,7 @@ func ParseConfig(configPath string) (*ProxyConfig, error) { } err = os.WriteFile(initialConfig.ConfigPath, sampleConfigData, 0644) if err != nil { - return nil, fmt.Errorf("Failed to write sample config to file: %w", err) + return nil, fmt.Errorf("failed to write sample config to file: %w", err) } log.Fatal("Add your SDK key to the config file and run this command again.") } diff --git a/options_test.go b/options_test.go index 472032a..b7757d0 100644 --- a/options_test.go +++ b/options_test.go @@ -206,7 +206,7 @@ func TestParseConfig(t *testing.T) { } else { require.NoError(t, err) if !assert.Equal(t, test.expected, actual) { - pretty.Println(test.name, actual) + _, _ = pretty.Println(test.name, actual) } } })