Fix all golangci-lint warnings surfaced by v2.4.0 (#4567)

* Initial plan

* Fix all golangci-lint warnings (21 issues resolved)

Co-authored-by: gabek <414923+gabek@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: gabek <414923+gabek@users.noreply.github.com>
This commit is contained in:
Copilot
2025-09-25 20:03:40 -07:00
committed by GitHub
co-authored by gabek copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
parent 19a4593a12
commit a0066fcf54
12 changed files with 60 additions and 63 deletions
+1 -2
View File
@@ -6,7 +6,6 @@ import (
"time"
"github.com/owncast/owncast/logging"
"github.com/sirupsen/logrus"
log "github.com/sirupsen/logrus"
)
@@ -49,7 +48,7 @@ type logsResponse struct {
Level string `json:"level"`
}
func fromEntry(e *logrus.Entry) logsResponse {
func fromEntry(e *log.Entry) logsResponse {
return logsResponse{
Message: e.Message,
Level: e.Level.String(),
+4 -3
View File
@@ -11,14 +11,15 @@ import (
// HandleAuthEndpoint will handle the IndieAuth auth endpoint.
func HandleAuthEndpoint(w http.ResponseWriter, r *http.Request) {
if r.Method == http.MethodGet {
switch r.Method {
case http.MethodGet:
// Require the GET request for IndieAuth to be behind admin login.
f := middleware.RequireAdminAuth(HandleAuthEndpointGet)
f(w, r)
return
} else if r.Method == http.MethodPost {
case http.MethodPost:
HandleAuthEndpointPost(w, r)
} else {
default:
w.WriteHeader(http.StatusMethodNotAllowed)
return
}
+4 -3
View File
@@ -71,13 +71,14 @@ func Start(enableVerboseLogging bool) error {
m := http.NewServeMux()
m.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/debug/vars" {
switch r.URL.Path {
case "/debug/vars":
w.WriteHeader(http.StatusNotFound)
return
} else if r.URL.Path == "/embed/chat/" || r.URL.Path == "/embed/chat" {
case "/embed/chat/", "/embed/chat":
// Redirect /embed/chat
http.Redirect(w, r, "/embed/chat/readonly", http.StatusTemporaryRedirect)
} else {
default:
http2Handler.ServeHTTP(w, r)
}
})