Files
owncast/utils/restendpointhelper.go
Copilot a0066fcf54 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>
2025-09-25 20:03:40 -07:00

18 lines
351 B
Go

package utils
import (
"errors"
"net/http"
"github.com/go-chi/chi/v5"
)
// GetURLParam retrieves the specified URL param from a given request.
func GetURLParam(r *http.Request, key string) (value string, err error) {
value = chi.URLParam(r, key)
if value == "" {
err = errors.New("request does not contain requested URL param")
}
return
}