mirror of https://git.sr.ht/~sircmpwn/core-go
go fmt
This commit is contained in:
parent
76279c9b1c
commit
f44afb103e
|
@ -85,7 +85,7 @@ func authError(w http.ResponseWriter, reason string, code int) {
|
|||
gqlerr := gqlerror.Errorf("Authentication error: %s", reason)
|
||||
b, err := json.Marshal(struct {
|
||||
Errors []*gqlerror.Error `json:"errors"`
|
||||
} {
|
||||
}{
|
||||
Errors: []*gqlerror.Error{gqlerr},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
|
@ -4,9 +4,9 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.sr.ht/~sircmpwn/core-go/auth"
|
||||
"git.sr.ht/~sircmpwn/core-go/config"
|
||||
"git.sr.ht/~sircmpwn/core-go/crypto"
|
||||
"git.sr.ht/~sircmpwn/core-go/auth"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
|
|
@ -7,9 +7,9 @@ import (
|
|||
"net/mail"
|
||||
"strconv"
|
||||
|
||||
_ "github.com/emersion/go-message/charset"
|
||||
"github.com/emersion/go-sasl"
|
||||
"github.com/emersion/go-smtp"
|
||||
_ "github.com/emersion/go-message/charset"
|
||||
|
||||
"git.sr.ht/~sircmpwn/core-go/config"
|
||||
)
|
||||
|
|
|
@ -13,10 +13,10 @@ import (
|
|||
"time"
|
||||
|
||||
"git.sr.ht/~sircmpwn/dowork"
|
||||
_ "github.com/emersion/go-message/charset"
|
||||
"github.com/emersion/go-message/mail"
|
||||
"github.com/emersion/go-pgpmail"
|
||||
"golang.org/x/crypto/openpgp"
|
||||
_ "github.com/emersion/go-message/charset"
|
||||
|
||||
"git.sr.ht/~sircmpwn/core-go/config"
|
||||
)
|
||||
|
|
|
@ -5,9 +5,9 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
gomail "net/mail"
|
||||
"runtime"
|
||||
"strings"
|
||||
gomail "net/mail"
|
||||
|
||||
"github.com/99designs/gqlgen/graphql"
|
||||
"github.com/emersion/go-message/mail"
|
||||
|
|
|
@ -41,7 +41,7 @@ func NewAuthConfig(ctx context.Context) (AuthConfig, error) {
|
|||
_clientID := user.BearerToken.ClientID
|
||||
clientID = &_clientID
|
||||
}
|
||||
return AuthConfig {
|
||||
return AuthConfig{
|
||||
AuthMethod: user.AuthMethod,
|
||||
TokenHash: &tokenHash,
|
||||
Grants: &grants,
|
||||
|
|
|
@ -13,8 +13,8 @@ import (
|
|||
"time"
|
||||
|
||||
"git.sr.ht/~sircmpwn/dowork"
|
||||
"github.com/google/uuid"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/google/uuid"
|
||||
|
||||
"git.sr.ht/~sircmpwn/core-go/crypto"
|
||||
"git.sr.ht/~sircmpwn/core-go/database"
|
||||
|
|
|
@ -11,9 +11,9 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/vaughan0/go-ini"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
|
||||
"git.sr.ht/~sircmpwn/core-go/crypto"
|
||||
"git.sr.ht/~sircmpwn/core-go/database"
|
||||
|
@ -39,7 +39,7 @@ type argContains struct {
|
|||
matches []string
|
||||
}
|
||||
|
||||
func ArgMatchesAll(matches... string) *argContains {
|
||||
func ArgMatchesAll(matches ...string) *argContains {
|
||||
return &argContains{matches}
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ func TestDelivery(t *testing.T) {
|
|||
WillReturnRows(sqlmock.NewRows([]string{
|
||||
"sub.id", "sub.created", "sub.url", "sub.events",
|
||||
}).AddRow(1337, time.Now().UTC(),
|
||||
srv.URL + "/webhook", "profile:update")).
|
||||
srv.URL+"/webhook", "profile:update")).
|
||||
WithArgs(42, sqlmock.AnyArg()) // Any => events LIKE %profile:update%
|
||||
mock.ExpectCommit()
|
||||
|
||||
|
|
|
@ -14,8 +14,8 @@ import (
|
|||
|
||||
"git.sr.ht/~sircmpwn/dowork"
|
||||
"github.com/99designs/gqlgen/graphql"
|
||||
"github.com/google/uuid"
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/google/uuid"
|
||||
|
||||
"git.sr.ht/~sircmpwn/core-go/auth"
|
||||
"git.sr.ht/~sircmpwn/core-go/crypto"
|
||||
|
|
Loading…
Reference in New Issue