Skip to content

Commit

Permalink
Bump golang and golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nhatthm committed Aug 24, 2021
1 parent 7146ba5 commit aae1371
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 65 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2.5.1
uses: golangci/golangci-lint-action@v2.5.2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.39.0
version: v1.42.0

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ on:

env:
GO111MODULE: "on"
GO_LATEST_VERSION: "1.16.x"
GO_LATEST_VERSION: "1.17.x"

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
go-version: [ 1.14.x, 1.15.x, 1.16.x ]
go-version: [ 1.16.x, 1.17.x ]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
Expand Down
26 changes: 14 additions & 12 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,30 @@ linters-settings:
linters:
enable-all: true
disable:
- lll
- maligned
- gochecknoglobals
- gomnd
- wrapcheck
- paralleltest
- forbidigo
- exhaustivestruct
- interfacer
- forbidigo
- forcetypeassert
- gci
- gochecknoglobals
- golint
- gomnd
- ifshort
- interfacer
- lll
- maligned
- paralleltest
- scopelint
- testpackage
- gci
- wrapcheck

issues:
exclude-use-default: false
exclude-rules:
- linters:
- gomnd
- dupl
- funlen
- goconst
- goerr113
- gomnd
- noctx
- funlen
- dupl
path: "_test.go"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

## Prerequisites

- `Go >= 1.14`
- `Go >= 1.16`

## Install

Expand Down
6 changes: 4 additions & 2 deletions features/bootstrap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/cucumber/godog"
"github.com/google/uuid"
clock "github.com/nhatthm/go-clock"
"github.com/nhatthm/go-clock"
"github.com/nhatthm/n26api"
"github.com/nhatthm/n26api/pkg/transaction"
"github.com/nhatthm/timeparser"
Expand All @@ -23,8 +23,10 @@ type client struct {
}

func (c *client) registerContext(ctx *godog.ScenarioContext) {
ctx.AfterScenario(func(*godog.Scenario, error) {
ctx.After(func(context.Context, *godog.Scenario, error) (context.Context, error) {
c.api = nil

return nil, nil
})

ctx.Step(`create a n26 client with username "([^"]+)", password "([^"]+)" and device id "([^"]+)"`, c.newAPIClient)
Expand Down
33 changes: 27 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
module github.com/nhatthm/n26godog

go 1.16
go 1.17

require (
github.com/cucumber/godog v0.11.0
github.com/google/uuid v1.2.0
github.com/nhatthm/clockdog v0.1.2
github.com/cucumber/godog v0.12.0
github.com/google/uuid v1.3.0
github.com/nhatthm/clockdog v0.1.3
github.com/nhatthm/go-clock v0.6.0
github.com/nhatthm/n26api v0.3.5
github.com/nhatthm/n26api v0.3.6
github.com/nhatthm/timeparser v0.2.0
github.com/stretchr/testify v1.7.0
github.com/swaggest/assertjson v1.6.4
github.com/swaggest/assertjson v1.6.7
)

require (
github.com/bool64/ctxd v1.0.0 // indirect
github.com/bool64/shared v0.1.3 // indirect
github.com/cucumber/gherkin-go/v19 v19.0.3 // indirect
github.com/cucumber/messages-go/v16 v16.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/gofrs/uuid v4.0.0+incompatible // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.2 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/iancoleman/orderedmap v0.2.0 // indirect
github.com/nhatthm/httpmock v0.6.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.3.0 // indirect
github.com/yudai/gojsondiff v1.0.0 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
66 changes: 27 additions & 39 deletions go.sum

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion server.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package n26godog

import (
"context"
"encoding/json"
"io/ioutil"
"strconv"
Expand All @@ -23,10 +24,12 @@ type Server struct {

// RegisterContext registers Server to a scenario.
func (s *Server) RegisterContext(ctx *godog.ScenarioContext) {
ctx.AfterScenario(func(*godog.Scenario, error) {
ctx.After(func(context.Context, *godog.Scenario, error) (context.Context, error) {
assert.NoError(s.test, s.ExpectationsWereMet())

s.ResetExpectations()

return nil, nil
})

// Auth.
Expand Down

0 comments on commit aae1371

Please sign in to comment.