diff --git a/handler/base.go b/handler/base.go index 28dfa98..3c6214a 100644 --- a/handler/base.go +++ b/handler/base.go @@ -10,9 +10,7 @@ const ( ContextUser ctxKey = "context_user" ) -var ( - secureCookie *securecookie.SecureCookie -) +var secureCookie *securecookie.SecureCookie type ctxKey string @@ -22,8 +20,7 @@ type Authorize struct { } func genId() string { - id, _ := uuid.NewRandom() - return id.String() + return uuid.Must(uuid.NewRandom()).String() } func SetSecureCookie(sc *securecookie.SecureCookie) { diff --git a/handler/short_url.go b/handler/short_url.go index b82799a..d17520e 100644 --- a/handler/short_url.go +++ b/handler/short_url.go @@ -2,7 +2,6 @@ package handler import ( "io/fs" - "log" "net/http" "time" @@ -36,8 +35,6 @@ func CreateShortUrl(templates fs.FS, store db.Store) http.HandlerFunc { return } - log.Println(shortUrl) - _, err = store.CreateUserUrl(ctx, &db.CreateUserUrlParams{ UserID: user.ID, ShortUrl: shortUrl,