This commit is contained in:
lbenedar
2026-02-27 12:52:18 +03:00
parent 41bf28c77d
commit 2e513bb91e

View File

@@ -1,8 +1,10 @@
package main
import (
"fmt"
"log"
"net/http"
"strconv"
)
func home(w http.ResponseWriter, r *http.Request) {
@@ -14,7 +16,12 @@ func home(w http.ResponseWriter, r *http.Request) {
}
func snippetView(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Display a specific snippet..."))
id, err := strconv.Atoi(r.URL.Query().Get("id"))
if err != nil || id < 1 {
http.NotFound(w, r)
return
}
fmt.Fprintf(w, "Display a specific snippet with ID %d...", id)
}
func snippetCreate(w http.ResponseWriter, r *http.Request) {