Fix lint issue

This commit is contained in:
rroller 2025-10-05 18:44:39 -07:00
parent 8bd20aae17
commit b05152474a
3 changed files with 7 additions and 6 deletions

1
.tool-versions Normal file
View file

@ -0,0 +1 @@
golang 1.25.1

View file

@ -3,8 +3,6 @@ package main
import ( import (
"context" "context"
"errors" "errors"
"github.com/go-chi/chi/v5"
"github.com/rs/zerolog/log"
"media-roller/src/media" "media-roller/src/media"
"net/http" "net/http"
"os" "os"
@ -14,6 +12,9 @@ import (
"strings" "strings"
"syscall" "syscall"
"time" "time"
"github.com/go-chi/chi/v5"
"github.com/rs/zerolog/log"
) )
func main() { func main() {
@ -119,7 +120,7 @@ func fileServer(r chi.Router, public string, static string) {
fs := http.StripPrefix(public, http.FileServer(http.Dir(root))) fs := http.StripPrefix(public, http.FileServer(http.Dir(root)))
if public != "/" && public[len(public)-1] != '/' { if public != "/" && public[len(public)-1] != '/' {
r.Get(public, http.RedirectHandler(public+"/", 301).ServeHTTP) r.Get(public, http.RedirectHandler(public+"/", http.StatusMovedPermanently).ServeHTTP)
public += "/" public += "/"
} }

View file

@ -5,6 +5,5 @@ go get -u ./...
go mod tidy go mod tidy
go fmt ./... go fmt ./...
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.5 golangci-lint --version
$(go env GOPATH)/bin/golangci-lint --version golangci-lint run
$(go env GOPATH)/bin/golangci-lint run