Skip to content

Commit

Permalink
chore: bump gofmt and go version to 1.20 (supabase#972)
Browse files Browse the repository at this point in the history
new version of gofmt was released on 14th which seems to enforce
lexicographic import are formatte and so it seems like running gofmt
will now enforce lexicographic ordering on imports

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
J0 and [email protected] authored Feb 15, 2023
1 parent 4f5c2f6 commit ed7b2dc
Show file tree
Hide file tree
Showing 70 changed files with 106 additions and 107 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ on:
types: [completed]
branches:
- master
- mfa
- zerosessionidfix
- lastsigninatfix

Expand Down Expand Up @@ -40,7 +39,7 @@ jobs:

- uses: actions/setup-go@v3
with:
go-version: "^1.19.0" # The Go version to download (if necessary) and use.
go-version: "^1.20.0" # The Go version to download (if necessary) and use.

- run: make deps
- run: make all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.19.x]
go-version: [1.20.x]
runs-on: ubuntu-20.04
services:
postgres:
Expand Down
4 changes: 2 additions & 2 deletions cmd/admin_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package cmd

import (
"github.com/gofrs/uuid"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/storage"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

var autoconfirm, isAdmin bool
Expand Down
4 changes: 2 additions & 2 deletions cmd/root_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cmd
import (
"context"

"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/observability"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/observability"
)

var configFile = ""
Expand Down
4 changes: 2 additions & 2 deletions cmd/serve_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"net"

"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/supabase/gotrue/internal/api"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/storage"
"github.com/supabase/gotrue/internal/utilities"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

var serveCmd = cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/version_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package cmd
import (
"fmt"

"github.com/supabase/gotrue/internal/utilities"
"github.com/spf13/cobra"
"github.com/supabase/gotrue/internal/utilities"
)

var versionCmd = cobra.Command{
Expand Down
2 changes: 1 addition & 1 deletion internal/api/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"github.com/fatih/structs"
"github.com/go-chi/chi"
"github.com/gofrs/uuid"
"github.com/sethvargo/go-password/password"
"github.com/supabase/gotrue/internal/api/provider"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/observability"
"github.com/supabase/gotrue/internal/storage"
"github.com/sethvargo/go-password/password"
)

type AdminUserParams struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
"time"

jwt "github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type AdminTestSuite struct {
Expand Down
6 changes: 3 additions & 3 deletions internal/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
"github.com/didip/tollbooth/v5"
"github.com/didip/tollbooth/v5/limiter"
"github.com/go-chi/chi"
"github.com/rs/cors"
"github.com/sebest/xff"
"github.com/sirupsen/logrus"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/mailer"
"github.com/supabase/gotrue/internal/observability"
"github.com/supabase/gotrue/internal/storage"
"github.com/rs/cors"
"github.com/sebest/xff"
"github.com/sirupsen/logrus"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"context"
"testing"

"github.com/stretchr/testify/require"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/crypto"
"github.com/supabase/gotrue/internal/storage"
"github.com/supabase/gotrue/internal/storage/test"
"github.com/stretchr/testify/require"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/api/audit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (
"time"

jwt "github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type AuditTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/gofrs/uuid"
jwt "github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type AuthTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"os"
"runtime/debug"

"github.com/pkg/errors"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/observability"
"github.com/supabase/gotrue/internal/utilities"
"github.com/pkg/errors"
)

// Common error messages during signup flow
Expand Down
2 changes: 1 addition & 1 deletion internal/api/external.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import (
"github.com/fatih/structs"
"github.com/gofrs/uuid"
jwt "github.com/golang-jwt/jwt"
"github.com/sirupsen/logrus"
"github.com/supabase/gotrue/internal/api/provider"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/observability"
"github.com/supabase/gotrue/internal/storage"
"github.com/supabase/gotrue/internal/utilities"
"github.com/sirupsen/logrus"
"golang.org/x/oauth2"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/api/external_github_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"time"

jwt "github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/require"
"github.com/supabase/gotrue/internal/models"
)

func (ts *ExternalTestSuite) TestSignupExternalGithub() {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/external_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"net/url"

"github.com/mrjones/oauth"
"github.com/sirupsen/logrus"
"github.com/supabase/gotrue/internal/api/provider"
"github.com/supabase/gotrue/internal/observability"
"github.com/supabase/gotrue/internal/storage"
"github.com/sirupsen/logrus"
)

// OAuthProviderData contains the userData and token returned by the oauth provider
Expand Down
4 changes: 2 additions & 2 deletions internal/api/external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"net/url"
"testing"

"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type ExternalTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"net/url"

"github.com/gofrs/uuid"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/utilities"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)

func addRequestID(globalConfig *conf.GlobalConfiguration) middlewareHandler {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/hook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"testing"
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/storage/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

// withFunctionHooks adds the provided function hooks to the context.
Expand Down
4 changes: 2 additions & 2 deletions internal/api/invite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
"time"

jwt "github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type InviteTestSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/api/logout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"testing"
"time"

"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type LogoutTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/magic_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"net/http"
"strings"

"github.com/sethvargo/go-password/password"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/storage"
"github.com/sethvargo/go-password/password"
)

// MagicLinkParams holds the parameters for a magic link request
Expand Down
4 changes: 2 additions & 2 deletions internal/api/mail.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import (

"github.com/badoux/checkmail"
"github.com/fatih/structs"
"github.com/pkg/errors"
"github.com/sethvargo/go-password/password"
"github.com/supabase/gotrue/internal/api/provider"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/crypto"
"github.com/supabase/gotrue/internal/mailer"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/storage"
"github.com/pkg/errors"
"github.com/sethvargo/go-password/password"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions internal/api/mail_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"testing"

"github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
)

type MailTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/mfa.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
svg "github.com/ajstarks/svgo"
"github.com/boombuler/barcode/qr"
"github.com/gofrs/uuid"
"github.com/pquerna/otp/totp"
"github.com/supabase/gotrue/internal/metering"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/storage"
"github.com/supabase/gotrue/internal/utilities"
"github.com/pquerna/otp/totp"
)

const DefaultQRSize = 3
Expand Down
2 changes: 1 addition & 1 deletion internal/api/mfa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"testing"
"time"

"github.com/pquerna/otp"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/utilities"
"github.com/pquerna/otp"

"github.com/jackc/pgx/v4"

Expand Down
2 changes: 1 addition & 1 deletion internal/api/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"testing"

jwt "github.com/golang-jwt/jwt"
"github.com/supabase/gotrue/internal/conf"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions internal/api/opentelemetry-tracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"net/http/httptest"
"testing"

"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/storage"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/storage"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
Expand Down
4 changes: 2 additions & 2 deletions internal/api/opentracer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import (
"net/http/httptest"
"testing"

"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/storage"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/mocktracer"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/supabase/gotrue/internal/conf"
"github.com/supabase/gotrue/internal/storage"
)

type OpenTracerTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/api/otp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"io"
"net/http"

"github.com/sethvargo/go-password/password"
"github.com/supabase/gotrue/internal/api/sms_provider"
"github.com/supabase/gotrue/internal/models"
"github.com/supabase/gotrue/internal/storage"
"github.com/sethvargo/go-password/password"
)

// OtpParams contains the request body params for the otp endpoint
Expand Down
Loading

0 comments on commit ed7b2dc

Please sign in to comment.