diff --git a/backend/cmd/threadule/main.go b/backend/cmd/threadule/main.go index e74e41d..3ff660e 100644 --- a/backend/cmd/threadule/main.go +++ b/backend/cmd/threadule/main.go @@ -10,7 +10,7 @@ import ( "threadule/backend/internal/config" "threadule/backend/internal/data" "threadule/backend/internal/logic" - router "threadule/backend/internal/router" + "threadule/backend/internal/router" "threadule/backend/internal/web" ) diff --git a/backend/internal/data/tweet..go b/backend/internal/data/tweet.go similarity index 100% rename from backend/internal/data/tweet..go rename to backend/internal/data/tweet.go diff --git a/backend/internal/logic/password.go b/backend/internal/logic/password.go index 1b61505..4356ea6 100644 --- a/backend/internal/logic/password.go +++ b/backend/internal/logic/password.go @@ -7,11 +7,13 @@ import ( "time" ) -const defaultPasswordLength = 16 -const defaultPasswordCharSet = "abcdefghijklmnopqrstuvwxyz" + - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + - "0123456789" + - "=!$%&+#-_.,;:" +const ( + defaultPasswordLength = 16 + defaultPasswordCharSet = "abcdefghijklmnopqrstuvwxyz" + + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + + "0123456789" + + "=!$%&+#-_.,;:" +) func (l *Logic) defaultPassword() string { builder := strings.Builder{} diff --git a/backend/internal/logic/twitter.go b/backend/internal/logic/twitter.go index 42ddc91..201767f 100644 --- a/backend/internal/logic/twitter.go +++ b/backend/internal/logic/twitter.go @@ -1,12 +1,12 @@ package logic import ( + "github.com/dghubble/go-twitter/twitter" + "github.com/dghubble/oauth1" + twitterOAuth "github.com/dghubble/oauth1/twitter" "net/url" "threadule/backend/internal/data/models" ) -import "github.com/dghubble/oauth1" -import "github.com/dghubble/go-twitter/twitter" -import twitterOAuth "github.com/dghubble/oauth1/twitter" func (l *Logic) sendTweet(client *twitter.Client, tweet *models.Tweet, prevId int64) (int64, error) { status, _, err := client.Statuses.Update( diff --git a/backend/internal/router/middleware.go b/backend/internal/router/middleware.go index 5b9b5e7..70dbfd1 100644 --- a/backend/internal/router/middleware.go +++ b/backend/internal/router/middleware.go @@ -3,7 +3,7 @@ package router import ( "net/http" "strings" - . "threadule/backend/internal/presentation" + "threadule/backend/internal/presentation" "threadule/backend/internal/web" ) @@ -13,14 +13,14 @@ func authenticated(next web.Handler) web.Handler { return func(ctx *web.Context) { authHeader := ctx.Request.Header.Get("Authorization") if !strings.HasPrefix(authHeader, authPrefix) { - StatusResponse(ctx, http.StatusBadRequest, "Authorization header missing or malformed") + presentation.StatusResponse(ctx, http.StatusBadRequest, "Authorization header missing or malformed") return } authHeader = strings.TrimPrefix(authHeader, authPrefix) user, err := ctx.AppCtx.Logic.AuthenticateSession(authHeader) if err != nil { - StatusResponse(ctx, http.StatusUnauthorized, err.Error()) + presentation.StatusResponse(ctx, http.StatusUnauthorized, err.Error()) return } diff --git a/backend/internal/web/server.go b/backend/internal/web/server.go index 7b9d345..5db4499 100644 --- a/backend/internal/web/server.go +++ b/backend/internal/web/server.go @@ -7,6 +7,6 @@ import ( ) func StartServer(ctx *app.Context, handler http.Handler) error { - ctx.Log.Info("startinhg web server") + ctx.Log.Info("starting web server") return http.ListenAndServe(fmt.Sprintf("0.0.0.0:%d", ctx.Config.Web.Port), handler) }