Skip to content

Commit

Permalink
fix: add err check to ParseBool
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed May 30, 2024
1 parent 0699f60 commit 169b103
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/build/id_request_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ func GetIDRequestToken(c *gin.Context) {

image := c.Query("image")
request := c.Query("request")
commands, _ := strconv.ParseBool(c.Query("commands"))
commands, err := strconv.ParseBool(c.Query("commands"))
if err != nil {

Check failure on line 100 in api/build/id_request_token.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] api/build/id_request_token.go#L100

only one cuddle assignment allowed before if statement (wsl)
Raw output
api/build/id_request_token.go:100:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^
retErr := fmt.Errorf("unable to parse 'commands' query %s: %w", c.Query("commands"), err)

util.HandleError(c, http.StatusBadRequest, retErr)

return
}

// retrieve token manager from context
tm := c.MustGet("token-manager").(*token.Manager)
Expand Down

0 comments on commit 169b103

Please sign in to comment.