Skip to content

Commit

Permalink
chore: fix golangci lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bschaatsbergen committed Mar 16, 2024
1 parent 0fd3cfa commit a9ba324
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/provider/http_client_error_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r IsHTTPClientErrorFunction) Run(ctx context.Context, req function.RunRequ
resp.Error = function.ConcatFuncErrors(resp.Result.Set(ctx, isHTTPClientError(statusCode.ValueInt64())))
}

// isHTTPClientError checks if an HTTP status code is within the 4xx range
// isHTTPClientError checks if an HTTP status code is within the 4xx range.
func isHTTPClientError(statusCode int64) bool {
switch statusCode {
case
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/http_redirect_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r IsHTTPRedirectFunction) Run(ctx context.Context, req function.RunRequest
resp.Error = function.ConcatFuncErrors(resp.Result.Set(ctx, isRedirectStatusCode(statusCode.ValueInt64())))
}

// isValid3xxStatusCode checks if an HTTP status code is within the 3xx range
// isValid3xxStatusCode checks if an HTTP status code is within the 3xx range.
func isRedirectStatusCode(statusCode int64) bool {
switch statusCode {
case
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/http_server_error_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r IsHTTPServerErrorFunction) Run(ctx context.Context, req function.RunRequ
resp.Error = function.ConcatFuncErrors(resp.Result.Set(ctx, isHTTPServerError(statusCode.ValueInt64())))
}

// isHTTPServerError checks if an HTTP status code is within the 5xx range
// isHTTPServerError checks if an HTTP status code is within the 5xx range.
func isHTTPServerError(statusCode int64) bool {
switch statusCode {
case
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/http_success_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r IsHTTPSuccessFunction) Run(ctx context.Context, req function.RunRequest,
resp.Error = function.ConcatFuncErrors(resp.Result.Set(ctx, isSuccessStatusCode(statusCode.ValueInt64())))
}

// isValid2xxStatusCode checks if an HTTP status code is within the 2xx range
// isValid2xxStatusCode checks if an HTTP status code is within the 2xx range.
func isSuccessStatusCode(statusCode int64) bool {
switch statusCode {
case
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/valid_json_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func isValidJSON(JSON *string) (bool, error) {
var js map[string]interface{}
err := json.Unmarshal([]byte(*JSON), &js)
if err != nil {
return false, nil
return false, err
}
return true, nil
}
2 changes: 1 addition & 1 deletion internal/provider/valid_yaml_function.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func isValidYAML(YAML *string) (bool, error) {
var js map[string]interface{}
err := yaml.Unmarshal([]byte(*YAML), &js)
if err != nil {
return false, nil
return false, err
}
return true, nil
}

0 comments on commit a9ba324

Please sign in to comment.