Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
clydemeng committed Dec 11, 2023
1 parent 4257f25 commit be000f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ SHELL := /bin/bash

build:
go build -o ./build/gnfd-cmd cmd/*.go

golangci_lint_cmd=golangci-lint
golangci_version=v1.51.2

lint:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --timeout=10m

lint-fix:
@echo "--> Running linter"
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@$(golangci_version)
@$(golangci_lint_cmd) run --fix --out-format=tab --issues-exit-code=0
5 changes: 4 additions & 1 deletion cmd/cmd_tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ func setTag(ctx *cli.Context) error {

tagsParam := ctx.String(tagFlag)
if tagsParam == "" {
toCmdErr(errors.New("invalid tags parameter"))
err = errors.New("invalid tags parameter")
}
if err != nil {
return toCmdErr(err)
}
tags := &storageTypes.ResourceTags{}
err = json.Unmarshal([]byte(tagsParam), &tags.Tags)
Expand Down

0 comments on commit be000f9

Please sign in to comment.