Skip to content

Commit 54e6a83

Browse files
committed
chore: fix golangci-lint
1 parent 98e79fa commit 54e6a83

7 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/ci-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: golangci/golangci-lint-action@v9
1818
with:
1919
version: latest
20-
args: --print-resources-usage
20+
args: --verbose
2121

2222
- name: Docker meta
2323
id: docker_meta

.github/workflows/release-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: golangci/golangci-lint-action@v9
2323
with:
2424
version: latest
25-
args: --print-resources-usage
25+
args: --verbose
2626

2727
build:
2828
needs: lint

.github/workflows/scheduled-docker.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: golangci/golangci-lint-action@v9
2020
with:
2121
version: latest
22-
args: --print-resources-usage
22+
args: --verbose
2323

2424
build:
2525
needs: lint

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cram-test: build
5959

6060
.PHONY: lint
6161
lint: $(GOLANGCI_LINT_BIN)
62-
time $(GOLANGCI_LINT_BIN) run --verbose --print-resources-usage
62+
time $(GOLANGCI_LINT_BIN) run --verbose --verbose
6363

6464
$(GOLANGCI_LINT_BIN):
6565
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(FIRST_GOPATH)/bin

filehandling.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// buffered reader.
1616
func Readln(r *bufio.Reader) (string, error) {
1717
var (
18-
isPrefix bool = true
18+
isPrefix = true
1919
err error = nil
2020
line, ln []byte
2121
)

log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func logError(err error) {
2020

2121
// Log error object as message
2222
func logFatalErrorAndExit(err error, exitCode int) {
23-
cmdline := fmt.Sprintf("%s %s", argparser.Command.Name, strings.Join(os.Args[1:], " "))
23+
cmdline := fmt.Sprintf("%s %s", argparser.Name, strings.Join(os.Args[1:], " "))
2424

2525
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
2626
fmt.Fprintf(os.Stderr, "Command: %s\n", cmdline)

main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ var pathFilterDirectories = []string{"autom4te.cache", "blib", "_build", ".bzr",
7777
// Apply changesets to file
7878
func applyChangesetsToFile(fileitem fileitem, changesets []changeset) (string, bool, error) {
7979
var (
80-
output string = ""
81-
status bool = true
80+
output = ""
81+
status = true
8282
)
8383

8484
// try open file
@@ -278,7 +278,7 @@ func handleSpecialCliOptions(args []string) {
278278

279279
// --output
280280
if opts.Output != "" && len(args) > 1 {
281-
logFatalErrorAndExit(errors.New("Only one file is allowed when using --output"), 1)
281+
logFatalErrorAndExit(errors.New("only one file is allowed when using --output"), 1)
282282
}
283283

284284
if opts.LineinfileBefore != "" || opts.LineinfileAfter != "" {
@@ -287,7 +287,7 @@ func handleSpecialCliOptions(args []string) {
287287
}
288288

289289
if opts.LineinfileBefore != "" && opts.LineinfileAfter != "" {
290-
logFatalErrorAndExit(errors.New("Only --lineinfile-after or --lineinfile-before is allowed in --mode=lineinfile"), 1)
290+
logFatalErrorAndExit(errors.New("only --lineinfile-after or --lineinfile-before is allowed in --mode=lineinfile"), 1)
291291
}
292292
}
293293
}
@@ -330,7 +330,7 @@ func actionProcessFiles(changesets []changeset, fileitems []fileitem) int {
330330
os.Exit(0)
331331
} else {
332332
// no files found, print error and exit with error code
333-
logFatalErrorAndExit(errors.New("No files specified"), 1)
333+
logFatalErrorAndExit(errors.New("no files specified"), 1)
334334
}
335335
}
336336

@@ -381,7 +381,7 @@ func actionProcessFiles(changesets []changeset, fileitems []fileitem) int {
381381
}
382382

383383
if errorCount >= 1 {
384-
fmt.Fprintf(os.Stderr, "[ERROR] %s failed with %d error(s)\n", argparser.Command.Name, errorCount)
384+
fmt.Fprintf(os.Stderr, "[ERROR] %s failed with %d error(s)\n", argparser.Name, errorCount)
385385
return 1
386386
}
387387

@@ -394,14 +394,14 @@ func buildChangesets() []changeset {
394394
if !opts.ModeIsTemplate {
395395
if len(opts.Search) == 0 || len(opts.Replace) == 0 {
396396
// error: unequal numbers of search and replace options
397-
logFatalErrorAndExit(errors.New("Missing either --search or --replace for this mode"), 1)
397+
logFatalErrorAndExit(errors.New("missing either --search or --replace for this mode"), 1)
398398
}
399399
}
400400

401401
// check if search and replace options have equal lenght (equal number of options)
402402
if len(opts.Search) != len(opts.Replace) {
403403
// error: unequal numbers of search and replace options
404-
logFatalErrorAndExit(errors.New("Unequal numbers of search or replace options"), 1)
404+
logFatalErrorAndExit(errors.New("unequal numbers of search or replace options"), 1)
405405
}
406406

407407
// build changesets

0 commit comments

Comments
 (0)