Fix linter emptyStringTest rule

by replacing the length check with a string comparison.
This rule got introduced with the new GolangCI lint version.
This commit is contained in:
Maximilian Paß
2024-02-27 15:42:18 +01:00
parent 895dd8879f
commit 939904d406
3 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ func configureV1Router(router *mux.Router,
// It responds the release information stored in the configuration.
func Version(writer http.ResponseWriter, request *http.Request) {
release := config.Config.Sentry.Release
if len(release) > 0 {
if release != "" {
sendJSON(writer, release, http.StatusOK, request.Context())
} else {
writer.WriteHeader(http.StatusNotFound)

View File

@ -149,7 +149,7 @@ func parseEnvironmentID(request *http.Request) (dto.EnvironmentID, error) {
func parseFetchParameter(request *http.Request) (fetch bool, err error) {
fetchString := request.FormValue(fetchEnvironmentKey)
if len(fetchString) > 0 {
if fetchString != "" {
fetch, err = strconv.ParseBool(fetchString)
if err != nil {
return false, fmt.Errorf("could not parse fetch parameter: %w", err)