Skip to content

Commit

Permalink
Fixing linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
samlown committed Dec 31, 2024
1 parent c404ce3 commit 26cd70a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Test Go
on: [push, pull_request]
on: [push]
jobs:
test:
name: Test
Expand Down
21 changes: 10 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
run:
tests: true
max-same-issues: 50
skip-dirs:
- resources
- old
skip-files:
- cmd/protopkg/main.go

output:
print-issued-lines: false
Expand All @@ -19,13 +14,12 @@ linters:
- unconvert
- goimports
- unused
- vetshadow
- govet
- nakedret
- errcheck
- revive
- ineffassign
- goconst
- vet
- unparam
- gofmt

Expand All @@ -45,14 +39,19 @@ linters-settings:
- ifElseChain
gofmt:
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'a[b:len(a)]'
replacement: 'a[b:]'
- pattern: "interface{}"
replacement: "any"
- pattern: "a[b:len(a)]"
replacement: "a[b:]"

issues:
max-per-linter: 0
max-same: 0
exclude-dirs:
- resources
- old
exclude-files:
- cmd/protopkg/main.go
exclude-use-default: false
exclude:
# Captured by errcheck.
Expand Down
2 changes: 1 addition & 1 deletion reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ func (t *Schema) MarshalJSON() ([]byte, error) {
if err != nil {
return nil, err
}
if t.Extras == nil || len(t.Extras) == 0 {
if len(t.Extras) == 0 {
return b, nil
}
m, err := json.Marshal(t.Extras)
Expand Down
2 changes: 1 addition & 1 deletion reflect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func TestSchemaGeneration(t *testing.T) {
{&MinValue{}, &Reflector{}, "fixtures/schema_with_minimum.json"},
{&TestNullable{}, &Reflector{}, "fixtures/nullable.json"},
{&GrandfatherType{}, &Reflector{
AdditionalFields: func(r reflect.Type) []reflect.StructField {
AdditionalFields: func(_ reflect.Type) []reflect.StructField {
return []reflect.StructField{
{
Name: "Addr",
Expand Down

0 comments on commit 26cd70a

Please sign in to comment.