Skip to content

feat: fix golangci-lint errors - #2776

Merged
xlgmokha merged 2 commits into
supabase:masterfrom
xlgmokha:xlg/golangci-lint
Sep 2, 2026
Merged

feat: fix golangci-lint errors#2776
xlgmokha merged 2 commits into
supabase:masterfrom
xlgmokha:xlg/golangci-lint

Conversation

@xlgmokha

@xlgmokha xlgmokha commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

What kind of change does this PR introduce?

Chore. Auto fix golangci-lint errors.

$ golangci-lint run --fix ./...

What is the current behavior?

モ golangci-lint run
../../../../src/github.com/supabase/auth/internal/api/oauthserver/authorize_test.go:237:19: Error return value of `ts.DB.Close` is not checked (errcheck)
	defer ts.DB.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/api/oauthserver/handlers_test.go:56:19: Error return value of `ts.DB.Close` is not checked (errcheck)
	defer ts.DB.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/api/oauthserver/service_test.go:51:19: Error return value of `ts.DB.Close` is not checked (errcheck)
	defer ts.DB.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:94:28: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
		json.NewEncoder(w).Encode(map[string]interface{}{
		                         ^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:137:28: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
		json.NewEncoder(w).Encode(map[string]interface{}{
		                         ^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:258:29: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
			json.NewEncoder(w).Encode(map[string]interface{}{
			                         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/confload_test.go:14:11: Error return value of `os.Setenv` is not checked (errcheck)
	os.Setenv("GOTRUE_SITE_URL", "http://localhost:8080")
	         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/confload_test.go:15:11: Error return value of `os.Setenv` is not checked (errcheck)
	os.Setenv("GOTRUE_DB_DRIVER", "postgres")
	         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/confload_test.go:16:11: Error return value of `os.Setenv` is not checked (errcheck)
	os.Setenv("GOTRUE_DB_DATABASE_URL", "fake")
	         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/loader.go:253:15: Error return value of `f.Close` is not checked (errcheck)
	defer f.Close()
	             ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi.go:72:16: Error return value of `o.Close` is not checked (errcheck)
		defer o.Close()
		             ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi.go:191:26: Error return value of `httpRes.Body.Close` is not checked (errcheck)
	defer httpRes.Body.Close()
	                        ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi_test.go:32:20: Error return value of `inst.Close` is not checked (errcheck)
			defer inst.Close()
			                ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi_test.go:49:20: Error return value of `inst.Close` is not checked (errcheck)
			defer inst.Close()
			                ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi_test.go:77:20: Error return value of `inst.Close` is not checked (errcheck)
			defer inst.Close()
			                ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp.go:184:23: Error return value of `rsp.Body.Close` is not checked (errcheck)
		defer rsp.Body.Close()
		                    ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp_test.go:185:19: Error return value of `io.WriteString` is not checked (errcheck)
				io.WriteString(w, "12345")
				              ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp_test.go:196:19: Error return value of `io.WriteString` is not checked (errcheck)
				io.WriteString(w, `{"error": {"message": "failed to verify ip addres"}}`)
				              ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp_test.go:207:19: Error return value of `io.WriteString` is not checked (errcheck)
				io.WriteString(w, `{"error": {"message": "failed to verify ip addres", "http_code": 400}}`)
				              ^
../../../../src/github.com/supabase/auth/internal/indexworker/indexworker_test.go:84:17: Error return value of `ts.popDB.Close` is not checked (errcheck)
		ts.popDB.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/indexworker/indexworker_test.go:89:20: Error return value of `models.TruncateAll` is not checked (errcheck)
	models.TruncateAll(ts.db)
	                  ^
../../../../src/github.com/supabase/auth/internal/indexworker/indexworker_test.go:458:27: Error return value of `manipulatorDB.Close` is not checked (errcheck)
	defer manipulatorDB.Close()
	                         ^
../../../../src/github.com/supabase/auth/internal/mailer/templatemailer/template.go:486:22: Error return value of `res.Body.Close` is not checked (errcheck)
	defer res.Body.Close()
	                    ^
../../../../src/github.com/supabase/auth/internal/mailer/validateclient/validateclient.go:309:22: Error return value of `res.Body.Close` is not checked (errcheck)
	defer res.Body.Close()
	                    ^
../../../../src/github.com/supabase/auth/internal/mailer/validateclient/validateclient_test.go:34:16: Error return value of `fmt.Fprintln` is not checked (errcheck)
			fmt.Fprintln(w, `{"error": true}`)
			            ^
../../../../src/github.com/supabase/auth/internal/mailer/validateclient/validateclient_test.go:38:15: Error return value of `fmt.Fprintln` is not checked (errcheck)
		fmt.Fprintln(w, testResVal.Load().(string))
		            ^
../../../../src/github.com/supabase/auth/internal/models/custom_oauth_provider_test.go:24:13: Error return value is not checked (errcheck)
	TruncateAll(ts.db)
	           ^
../../../../src/github.com/supabase/auth/internal/models/custom_oauth_provider_test.go:38:19: Error return value of `ts.db.Close` is not checked (errcheck)
	defer ts.db.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/models/factor_test.go:31:19: Error return value of `ts.db.Close` is not checked (errcheck)
	defer ts.db.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/models/factor_test.go:62:13: Error return value is not checked (errcheck)
	TruncateAll(ts.db)
	           ^
../../../../src/github.com/supabase/auth/internal/models/factor_test.go:134:16: Error return value of `json.Unmarshal` is not checked (errcheck)
	json.Unmarshal(encodedFactor, &decodedFactor)
	              ^
../../../../src/github.com/supabase/auth/internal/models/identity_test.go:20:13: Error return value is not checked (errcheck)
	TruncateAll(ts.db)
	           ^
../../../../src/github.com/supabase/auth/internal/models/identity_test.go:33:19: Error return value of `ts.db.Close` is not checked (errcheck)
	defer ts.db.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/models/sso_test.go:297:25: Error return value of `(*github.com/gobuffalo/pop/v6.Connection).Destroy` is not checked (errcheck)
			ts.db.Eager().Destroy(pr)
			                     ^
../../../../src/github.com/supabase/auth/internal/models/sso_test.go:304:49: Error return value of `(*github.com/gobuffalo/pop/v6.Query).First` is not checked (errcheck)
		ts.db.Eager().Q().Where("id = ?", pr.ID).First(pr)
		                                              ^
../../../../src/github.com/supabase/auth/internal/reloader/poller.go:129:15: Error return value of `f.Close` is not checked (errcheck)
	defer f.Close()
	             ^
../../../../src/github.com/supabase/auth/internal/reloader/reloader.go:219:16: Error return value of `wr.Close` is not checked (errcheck)
	defer wr.Close()
	              ^
../../../../src/github.com/supabase/auth/internal/reloader/reloader_test.go:766:35: Error return value of `os.RemoveAll` is not checked (errcheck)
	return dir, func() { os.RemoveAll(dir) }
	                                 ^
../../../../src/github.com/supabase/auth/internal/storage/dial_test.go:120:17: Error return value of `db.Close` is not checked (errcheck)
		defer db.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/storage/dial_test.go:149:17: Error return value of `db.Close` is not checked (errcheck)
		defer db.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/storage/dial_test.go:231:17: Error return value of `db.Close` is not checked (errcheck)
		defer db.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:51:18: Error return value of `conn.Close` is not checked (errcheck)
	defer conn.Close()
	                ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:57:20: Error return value of `models.TruncateAll` is not checked (errcheck)
	models.TruncateAll(ts.Conn)
	                  ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:917:18: Error return value of `conn.Close` is not checked (errcheck)
	defer conn.Close()
	                ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:923:20: Error return value of `models.TruncateAll` is not checked (errcheck)
	models.TruncateAll(ts.Conn)
	                  ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:1302:18: Error return value of `conn.Close` is not checked (errcheck)
	defer conn.Close()
	                ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery.go:63:23: Error return value of `resp.Body.Close` is not checked (errcheck)
	defer resp.Body.Close()
	                     ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery_test.go:90:10: Error return value of `w.Write` is not checked (errcheck)
		w.Write([]byte(`{"issuer":"x","filler":"`))
		       ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery_test.go:91:10: Error return value of `w.Write` is not checked (errcheck)
		w.Write([]byte(strings.Repeat("A", MaxOIDCDiscoveryResponseSize+1024)))
		       ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery_test.go:92:10: Error return value of `w.Write` is not checked (errcheck)
		w.Write([]byte(`"}`))
		       ^
../../../../src/github.com/supabase/auth/internal/storage/dial.go:415:18: inline: Constant reflect.Ptr should be inlined (govet)
	if st.Kind() == reflect.Ptr {
	                ^
../../../../src/github.com/supabase/auth/internal/api/e2e_test.go:1243:5: ineffectual assignment to currentUser (ineffassign)
				currentUser := signupUser
				^
../../../../src/github.com/supabase/auth/internal/api/e2e_test.go:1468:5: ineffectual assignment to currentUser (ineffassign)
				currentUser := signupUser
				^
../../../../src/github.com/supabase/auth/internal/api/custom_oauth_admin.go:439:2: QF1003: could use tagged switch on providerType (staticcheck)
	if providerType == models.ProviderTypeOIDC {
	^
../../../../src/github.com/supabase/auth/internal/api/custom_oauth_admin.go:462:2: QF1003: could use tagged switch on providerType (staticcheck)
	if providerType == models.ProviderTypeOIDC {
	^
../../../../src/github.com/supabase/auth/internal/api/e2e_test.go:47:3: QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
		sb.WriteString(fmt.Sprintf("%d", rand.Intn(9)))
		^
../../../../src/github.com/supabase/auth/internal/api/external.go:409:47: QF1001: could apply De Morgan's law (staticcheck)
	hasEmails := providerType != Web3Provider && !(emailOptional && decision.CandidateEmail.Email == "")
	                                             ^
../../../../src/github.com/supabase/auth/internal/api/hooks.go:107:2: QF1007: could merge conditional assignment into variable declaration (staticcheck)
	isSSOUser := false
	^
../../../../src/github.com/supabase/auth/internal/api/mail.go:258:4: QF1003: could use tagged switch on params.Type (staticcheck)
			if params.Type == "email_change_current" {
			^
../../../../src/github.com/supabase/auth/internal/api/mfa_test.go:531:4: QF1003: could use tagged switch on v.factorType (staticcheck)
			if v.factorType == models.TOTP {
			^
../../../../src/github.com/supabase/auth/internal/api/mfa_test.go:553:4: QF1003: could use tagged switch on v.factorType (staticcheck)
			if v.factorType == models.TOTP {
			^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:256:3: QF1003: could use tagged switch on r.URL.Path (staticcheck)
		if r.URL.Path == "/.well-known/openid-configuration" {
		^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:388:3: QF1003: could use tagged switch on r.URL.Path (staticcheck)
		if r.URL.Path == "/.well-known/openid-configuration" {
		^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:490:3: QF1003: could use tagged switch on r.URL.Path (staticcheck)
		if r.URL.Path == "/.well-known/openid-configuration" {
		^
../../../../src/github.com/supabase/auth/internal/api/provider/facebook.go:82:40: QF1008: could remove embedded field "Config" from selector (staticcheck)
	hash := hmac.New(sha256.New, []byte(p.Config.ClientSecret))
	                                      ^
../../../../src/github.com/supabase/auth/internal/api/provider/google.go:90:16: QF1008: could remove embedded field "Config" from selector (staticcheck)
			ClientID: g.Config.ClientID,
			            ^
../../../../src/github.com/supabase/auth/internal/api/provider/twitch.go:97:32: QF1008: could remove embedded field "Config" from selector (staticcheck)
	req.Header.Set("Client-Id", t.Config.ClientID)
	                              ^
../../../../src/github.com/supabase/auth/internal/api/resend_test.go:269:5: QF1003: could use tagged switch on c.params["type"] (staticcheck)
				if c.params["type"] == mail.SignupVerification {
				^
../../../../src/github.com/supabase/auth/internal/api/sms_provider/twilio_verify.go:85:5: QF1001: could apply De Morgan's law (staticcheck)
	if !(res.StatusCode == http.StatusOK || res.StatusCode == http.StatusCreated) {
	   ^
../../../../src/github.com/supabase/auth/internal/api/sso_test.go:706:3: QF1003: could use tagged switch on example.Code (staticcheck)
		if example.Code == http.StatusSeeOther {
		^
../../../../src/github.com/supabase/auth/internal/api/verify.go:409:3: QF1003: could use tagged switch on params.Type (staticcheck)
		if params.Type == smsVerification {
		^
../../../../src/github.com/supabase/auth/internal/api/verify_test.go:754:4: QF1003: could use tagged switch on c.payload.Type (staticcheck)
			if c.payload.Type == "signup" {
			^
../../../../src/github.com/supabase/auth/internal/api/verify_test.go:1037:28: QF1008: could remove embedded field "expected" from selector (staticcheck)
			u.ConfirmationToken = c.expected.tokenHash
			                        ^
../../../../src/github.com/supabase/auth/internal/api/verify_test.go:1038:24: QF1008: could remove embedded field "expected" from selector (staticcheck)
			u.RecoveryToken = c.expected.tokenHash
			                    ^
../../../../src/github.com/supabase/auth/internal/api/verify_test.go:1039:30: QF1008: could remove embedded field "expected" from selector (staticcheck)
			u.EmailChangeTokenNew = c.expected.tokenHash
			                          ^
../../../../src/github.com/supabase/auth/internal/conf/configuration.go:788:46: QF1008: could remove embedded field "Time" from selector (staticcheck)
	if c.TestOTP != nil && (c.TestOTPValidUntil.Time.IsZero() || now.Before(c.TestOTPValidUntil.Time)) {
	                                            ^
../../../../src/github.com/supabase/auth/internal/conf/envparse/envparse.go:79:8: QF1004: could use bytes.ReplaceAll instead (staticcheck)
	src = bytes.Replace(src, []byte("\r\n"), []byte("\n"), -1)
	      ^
../../../../src/github.com/supabase/auth/internal/models/audit_log_entry.go:195:4: QF1012: Use fmt.Fprintf(...) instead of WriteString(fmt.Sprintf(...)) (staticcheck)
			builder.WriteString(fmt.Sprintf("payload->>'%s' ILIKE ?", col))
			^
../../../../src/github.com/supabase/auth/internal/models/custom_oauth_provider_test.go:542:2: QF1003: could use tagged switch on providerType (staticcheck)
	if providerType == ProviderTypeOAuth2 {
	^
../../../../src/github.com/supabase/auth/internal/models/oauth_authorization_test.go:371:20: QF1008: could remove embedded field "Connection" from selector (staticcheck)
	holdTx, err := db.Connection.NewTransaction()
	                  ^
80 issues:
* errcheck: 50
* govet: 1
* ineffassign: 2
* staticcheck: 27

What is the new behavior?

モ golangci-lint run
../../../../src/github.com/supabase/auth/internal/api/oauthserver/authorize_test.go:237:19: Error return value of `ts.DB.Close` is not checked (errcheck)
	defer ts.DB.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/api/oauthserver/handlers_test.go:56:19: Error return value of `ts.DB.Close` is not checked (errcheck)
	defer ts.DB.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/api/oauthserver/service_test.go:51:19: Error return value of `ts.DB.Close` is not checked (errcheck)
	defer ts.DB.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:94:28: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
		json.NewEncoder(w).Encode(map[string]interface{}{
		                         ^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:137:28: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
		json.NewEncoder(w).Encode(map[string]interface{}{
		                         ^
../../../../src/github.com/supabase/auth/internal/api/provider/custom_oauth_test.go:259:29: Error return value of `(*encoding/json.Encoder).Encode` is not checked (errcheck)
			json.NewEncoder(w).Encode(map[string]interface{}{
			                         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/confload_test.go:14:11: Error return value of `os.Setenv` is not checked (errcheck)
	os.Setenv("GOTRUE_SITE_URL", "http://localhost:8080")
	         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/confload_test.go:15:11: Error return value of `os.Setenv` is not checked (errcheck)
	os.Setenv("GOTRUE_DB_DRIVER", "postgres")
	         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/confload_test.go:16:11: Error return value of `os.Setenv` is not checked (errcheck)
	os.Setenv("GOTRUE_DB_DATABASE_URL", "fake")
	         ^
../../../../src/github.com/supabase/auth/internal/conf/confload/loader.go:253:15: Error return value of `f.Close` is not checked (errcheck)
	defer f.Close()
	             ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi.go:72:16: Error return value of `o.Close` is not checked (errcheck)
		defer o.Close()
		             ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi.go:191:26: Error return value of `httpRes.Body.Close` is not checked (errcheck)
	defer httpRes.Body.Close()
	                        ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi_test.go:32:20: Error return value of `inst.Close` is not checked (errcheck)
			defer inst.Close()
			                ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi_test.go:49:20: Error return value of `inst.Close` is not checked (errcheck)
			defer inst.Close()
			                ^
../../../../src/github.com/supabase/auth/internal/e2e/e2eapi/e2eapi_test.go:77:20: Error return value of `inst.Close` is not checked (errcheck)
			defer inst.Close()
			                ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp.go:184:23: Error return value of `rsp.Body.Close` is not checked (errcheck)
		defer rsp.Body.Close()
		                    ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp_test.go:185:19: Error return value of `io.WriteString` is not checked (errcheck)
				io.WriteString(w, "12345")
				              ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp_test.go:196:19: Error return value of `io.WriteString` is not checked (errcheck)
				io.WriteString(w, `{"error": {"message": "failed to verify ip addres"}}`)
				              ^
../../../../src/github.com/supabase/auth/internal/hooks/hookshttp/hookshttp_test.go:207:19: Error return value of `io.WriteString` is not checked (errcheck)
				io.WriteString(w, `{"error": {"message": "failed to verify ip addres", "http_code": 400}}`)
				              ^
../../../../src/github.com/supabase/auth/internal/indexworker/indexworker_test.go:84:17: Error return value of `ts.popDB.Close` is not checked (errcheck)
		ts.popDB.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/indexworker/indexworker_test.go:89:20: Error return value of `models.TruncateAll` is not checked (errcheck)
	models.TruncateAll(ts.db)
	                  ^
../../../../src/github.com/supabase/auth/internal/indexworker/indexworker_test.go:458:27: Error return value of `manipulatorDB.Close` is not checked (errcheck)
	defer manipulatorDB.Close()
	                         ^
../../../../src/github.com/supabase/auth/internal/mailer/templatemailer/template.go:486:22: Error return value of `res.Body.Close` is not checked (errcheck)
	defer res.Body.Close()
	                    ^
../../../../src/github.com/supabase/auth/internal/mailer/validateclient/validateclient.go:309:22: Error return value of `res.Body.Close` is not checked (errcheck)
	defer res.Body.Close()
	                    ^
../../../../src/github.com/supabase/auth/internal/mailer/validateclient/validateclient_test.go:34:16: Error return value of `fmt.Fprintln` is not checked (errcheck)
			fmt.Fprintln(w, `{"error": true}`)
			            ^
../../../../src/github.com/supabase/auth/internal/mailer/validateclient/validateclient_test.go:38:15: Error return value of `fmt.Fprintln` is not checked (errcheck)
		fmt.Fprintln(w, testResVal.Load().(string))
		            ^
../../../../src/github.com/supabase/auth/internal/models/custom_oauth_provider_test.go:24:13: Error return value is not checked (errcheck)
	TruncateAll(ts.db)
	           ^
../../../../src/github.com/supabase/auth/internal/models/custom_oauth_provider_test.go:38:19: Error return value of `ts.db.Close` is not checked (errcheck)
	defer ts.db.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/models/factor_test.go:31:19: Error return value of `ts.db.Close` is not checked (errcheck)
	defer ts.db.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/models/factor_test.go:62:13: Error return value is not checked (errcheck)
	TruncateAll(ts.db)
	           ^
../../../../src/github.com/supabase/auth/internal/models/factor_test.go:134:16: Error return value of `json.Unmarshal` is not checked (errcheck)
	json.Unmarshal(encodedFactor, &decodedFactor)
	              ^
../../../../src/github.com/supabase/auth/internal/models/identity_test.go:20:13: Error return value is not checked (errcheck)
	TruncateAll(ts.db)
	           ^
../../../../src/github.com/supabase/auth/internal/models/identity_test.go:33:19: Error return value of `ts.db.Close` is not checked (errcheck)
	defer ts.db.Close()
	                 ^
../../../../src/github.com/supabase/auth/internal/models/sso_test.go:297:25: Error return value of `(*github.com/gobuffalo/pop/v6.Connection).Destroy` is not checked (errcheck)
			ts.db.Eager().Destroy(pr)
			                     ^
../../../../src/github.com/supabase/auth/internal/models/sso_test.go:304:49: Error return value of `(*github.com/gobuffalo/pop/v6.Query).First` is not checked (errcheck)
		ts.db.Eager().Q().Where("id = ?", pr.ID).First(pr)
		                                              ^
../../../../src/github.com/supabase/auth/internal/reloader/poller.go:129:15: Error return value of `f.Close` is not checked (errcheck)
	defer f.Close()
	             ^
../../../../src/github.com/supabase/auth/internal/reloader/reloader.go:219:16: Error return value of `wr.Close` is not checked (errcheck)
	defer wr.Close()
	              ^
../../../../src/github.com/supabase/auth/internal/reloader/reloader_test.go:766:35: Error return value of `os.RemoveAll` is not checked (errcheck)
	return dir, func() { os.RemoveAll(dir) }
	                                 ^
../../../../src/github.com/supabase/auth/internal/storage/dial_test.go:120:17: Error return value of `db.Close` is not checked (errcheck)
		defer db.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/storage/dial_test.go:149:17: Error return value of `db.Close` is not checked (errcheck)
		defer db.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/storage/dial_test.go:231:17: Error return value of `db.Close` is not checked (errcheck)
		defer db.Close()
		              ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:51:18: Error return value of `conn.Close` is not checked (errcheck)
	defer conn.Close()
	                ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:57:20: Error return value of `models.TruncateAll` is not checked (errcheck)
	models.TruncateAll(ts.Conn)
	                  ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:917:18: Error return value of `conn.Close` is not checked (errcheck)
	defer conn.Close()
	                ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:923:20: Error return value of `models.TruncateAll` is not checked (errcheck)
	models.TruncateAll(ts.Conn)
	                  ^
../../../../src/github.com/supabase/auth/internal/tokens/service_test.go:1302:18: Error return value of `conn.Close` is not checked (errcheck)
	defer conn.Close()
	                ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery.go:63:23: Error return value of `resp.Body.Close` is not checked (errcheck)
	defer resp.Body.Close()
	                     ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery_test.go:90:10: Error return value of `w.Write` is not checked (errcheck)
		w.Write([]byte(`{"issuer":"x","filler":"`))
		       ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery_test.go:91:10: Error return value of `w.Write` is not checked (errcheck)
		w.Write([]byte(strings.Repeat("A", MaxOIDCDiscoveryResponseSize+1024)))
		       ^
../../../../src/github.com/supabase/auth/internal/utilities/oidc_discovery_test.go:92:10: Error return value of `w.Write` is not checked (errcheck)
		w.Write([]byte(`"}`))
		       ^
../../../../src/github.com/supabase/auth/internal/api/e2e_test.go:1243:5: ineffectual assignment to currentUser (ineffassign)
				currentUser := signupUser
				^
../../../../src/github.com/supabase/auth/internal/api/e2e_test.go:1468:5: ineffectual assignment to currentUser (ineffassign)
				currentUser := signupUser
				^
52 issues:
* errcheck: 50
* ineffassign: 2

Additional context

```bash
$ golangci-lint run --fix ./...
```
@xlgmokha xlgmokha self-assigned this Sep 1, 2026
@xlgmokha
xlgmokha marked this pull request as ready for review September 1, 2026 17:26
@xlgmokha
xlgmokha requested a review from a team as a code owner September 1, 2026 17:26

@annabkr annabkr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

request: can we add a .golangci.yml and wire up golangci-lint to CI?

@hf hf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title should be fix or feat, as it introduces a code change. Chore is more about things that don't actually change much about the codebase, if I'm not mistaken.

@xlgmokha

xlgmokha commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

request: can we add a .golangci.yml and wire up golangci-lint to CI?

@annabkr I added one in a branch over here but I haven't submitted the changes in a PR yet.

@xlgmokha xlgmokha changed the title chore: fix golangci-lint errors feat: fix golangci-lint errors Sep 2, 2026
@xlgmokha
xlgmokha merged commit 5e372a9 into supabase:master Sep 2, 2026
5 checks passed
@xlgmokha
xlgmokha deleted the xlg/golangci-lint branch September 2, 2026 23:35
@xlgmokha

xlgmokha commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

request: can we add a .golangci.yml and wire up golangci-lint to CI?

@annabkr I added one in a branch over here but I haven't submitted the changes in a PR yet.

I opened up #2784.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants