Skip to content

Commit 34b6c81

Browse files
Walzpierrelalanne
authored andcommitted
fix(ci): Fix lint and ignore some linter
1 parent 0b40229 commit 34b6c81

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ on:
77
branches: [main]
88

99
jobs:
10+
golangci:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: golangci-lint
16+
uses: golangci/golangci-lint-action@v2
17+
with:
18+
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
19+
version: v1.43
1020
build:
1121
name: Build & Test
1222
runs-on: ubuntu-latest
@@ -23,12 +33,6 @@ jobs:
2333
- name: Build
2434
run: go build -v .
2535

26-
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v2
28-
with:
29-
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
30-
version: v1.41
31-
3236
- name: Test
3337
run: |
3438
go test -race $(go list ./...) -v -coverprofile=.coverage.out

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ linters:
3636
- wrapcheck
3737
- exhaustivestruct
3838
- errorlint
39+
- ireturn
3940
# temporary disables
4041
- gci
4142
- gocritic
4243
- gofumpt
4344
- funlen
4445
- gocyclo
46+
- varnamelen
4547
disable-all: false
4648
presets:
4749
- bugs

exporter/output.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ func NewJSONExporter(output io.WriteCloser) Exporter {
3232
}
3333
}
3434

35-
func NewGzipJSONExporter(output io.WriteCloser) Exporter {
35+
func NewGzipJSONExporter(output io.Writer) Exporter {
3636
compressedWriter := gzip.NewWriter(output)
37+
3738
return &JSONExporter{
3839
elements: []*ExportGitFile{},
3940
encoder: json.NewEncoder(compressedWriter),
@@ -51,9 +52,11 @@ func (e *JSONExporter) Close() error {
5152
if err1 := e.encoder.Encode(e.elements); err1 != nil {
5253
return err1
5354
}
55+
5456
if err2 := e.writer.Close(); err2 != nil {
5557
return err2
5658
}
59+
5760
return nil
5861
}
5962

@@ -69,8 +72,9 @@ func NewJSONLExporter(output io.WriteCloser) Exporter {
6972
}
7073
}
7174

72-
func NewGzipJSONLExporter(output io.WriteCloser) Exporter {
75+
func NewGzipJSONLExporter(output io.Writer) Exporter {
7376
compressedWriter := gzip.NewWriter(output)
77+
7478
return &JSONLExporter{
7579
encoder: json.NewEncoder(compressedWriter),
7680
writer: compressedWriter,

0 commit comments

Comments
 (0)