Skip to content

Commit

Permalink
chore: golint
Browse files Browse the repository at this point in the history
Signed-off-by: Eduardo Morales <[email protected]>
  • Loading branch information
emoral435 committed Mar 7, 2024
1 parent bfbc836 commit 6279f1e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion backend/api/routes/user.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package routes

import (
"fmt"
"net/http"

db "github.com/emoral435/swole-goal/db/sqlc"
Expand All @@ -18,6 +19,6 @@ func CreateUser(res http.ResponseWriter, req *http.Request, store *db.Store) {

if err != nil {
res.WriteHeader(http.StatusBadRequest)
res.Write([]byte("Email already in use."))
fmt.Fprintf(res, "Email already in use.")
}
}
3 changes: 1 addition & 2 deletions backend/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func Serve(connection *sql.DB) {
func serveRoutes(mux *http.ServeMux, store *db.Store) {
// just for me hehe
mux.HandleFunc("GET /", func(res http.ResponseWriter, req *http.Request) {
res.Write([]byte("Server started."))
fmt.Fprintf(res, "server hath started")
})

// creates a user using http headers
Expand All @@ -41,7 +41,6 @@ func serveRoutes(mux *http.ServeMux, store *db.Store) {

// gets a single user
mux.HandleFunc("GET /user/{id}", func(res http.ResponseWriter, req *http.Request) {
fmt.Fprintf(res, "server hath started")
fmt.Fprintf(res, "server hath started, with an id of %s", req.PathValue("id"))
})
}

0 comments on commit 6279f1e

Please sign in to comment.