Skip to content

Commit 8d92190

Browse files
committed
🐛 Fixed build issues
Signed-off-by: kaynetik <aleksandar@nesovic.dev>
1 parent dc5e234 commit 8d92190

File tree

6 files changed

+29
-15
lines changed

6 files changed

+29
-15
lines changed

.golangci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ linters:
4747
- nakedret
4848
- nestif
4949
- prealloc
50-
- rowserrcheck
5150
- staticcheck
5251
- stylecheck
5352
- typecheck
@@ -64,7 +63,6 @@ linters:
6463
- gofumpt
6564
- goheader
6665
- noctx
67-
- sqlclosecheck
6866
- errorlint
6967
- paralleltest
7068
- tparallel
@@ -83,4 +81,9 @@ issues:
8381
- gochecknoglobals
8482
- path: _test\.go
8583
linters:
86-
- exhaustivestruct
84+
- exhaustivestruct
85+
- funlen
86+
- wrapcheck
87+
- path: server.go
88+
linters:
89+
- wrapcheck

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
lint:
2-
gofumpt -w -s ./..
2+
gofumpt -w ./..
33
golangci-lint run --fix
44

55
test:

build.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ func (oas *OAS) BuildStream(w io.Writer) error {
6464
if err != nil {
6565
return fmt.Errorf("writing issue occurred: %w", err)
6666
}
67+
6768
return nil
6869
}
6970

build_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,16 +212,19 @@ func TestOAS_BuildStream(t *testing.T) {
212212
},
213213
}
214214

215-
t.Parallel()
216215
for _, tt := range tests {
217-
t.Run(tt.name, func(t *testing.T) {
216+
trn := tt
217+
218+
t.Run(trn.name, func(t *testing.T) {
219+
t.Parallel()
220+
218221
w := &bytes.Buffer{}
219-
if err := tt.oas.BuildStream(w); (err != nil) != tt.wantErr {
220-
t.Errorf("OAS.BuildStream() error = %v, wantErr %v", err, tt.wantErr)
222+
if err := trn.oas.BuildStream(w); (err != nil) != trn.wantErr {
223+
t.Errorf("OAS.BuildStream() error = %v, wantErr %v", err, trn.wantErr)
221224
return
222225
}
223-
if gotW := w.String(); gotW != tt.wantW {
224-
t.Errorf("OAS.BuildStream() = [%v], want {%v}", gotW, tt.wantW)
226+
if gotW := w.String(); gotW != trn.wantW {
227+
t.Errorf("OAS.BuildStream() = [%v], want {%v}", gotW, trn.wantW)
225228
}
226229
})
227230
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/go-oas/docs
22

3-
go 1.18
3+
go 1.19
44

55
require gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
66

routing_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ func TestQuickUnitAttachRoutes(t *testing.T) {
270270
}
271271

272272
func TestOAS_AddRoute(t *testing.T) {
273+
t.Parallel()
274+
273275
var (
274276
respose200 = Response{Code: 200, Description: "Ok"}
275277
respose404 = Response{Code: 404, Description: "Not Found"}
@@ -321,11 +323,16 @@ func TestOAS_AddRoute(t *testing.T) {
321323
wantPaths: Paths{pathGetUser, pathCreateUser},
322324
},
323325
}
326+
324327
for _, tt := range tests {
325-
t.Run(tt.name, func(t *testing.T) {
326-
tt.oas.AddRoute(tt.path)
327-
if !reflect.DeepEqual(tt.wantPaths, tt.oas.Paths) {
328-
t.Errorf("OAS.AddRoute() = [%v], want {%v}", tt.oas.Paths, tt.wantPaths)
328+
trn := tt
329+
330+
t.Run(trn.name, func(t *testing.T) {
331+
t.Parallel()
332+
333+
trn.oas.AddRoute(trn.path)
334+
if !reflect.DeepEqual(trn.wantPaths, trn.oas.Paths) {
335+
t.Errorf("OAS.AddRoute() = [%v], want {%v}", trn.oas.Paths, trn.wantPaths)
329336
}
330337
})
331338
}

0 commit comments

Comments
 (0)