Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

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 eb64145 commit ce1ba21
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 85 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
25 changes: 16 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
module github.com/nhatthm/consoledog

go 1.16
go 1.17

require (
github.com/Netflix/go-expect v0.0.0-20210429232723-e923ed2d1db5
github.com/creack/pty v1.1.11
github.com/cucumber/godog v0.11.0
github.com/Netflix/go-expect v0.0.0-20210722184520-ef0bf57d82b3
github.com/creack/pty v1.1.15
github.com/cucumber/godog v0.12.0
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c
github.com/stretchr/testify v1.7.0
)

require (
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/gogo/protobuf v1.3.2 // indirect
github.com/hashicorp/go-immutable-radix v1.3.1 // indirect
github.com/hashicorp/go-memdb v1.3.2 // indirect
github.com/hinshun/vt10x v0.0.0-20180809195222-d55458df857c
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/kr/pty v1.1.8 // indirect
github.com/stretchr/testify v1.7.0
golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc // indirect
golang.org/x/sys v0.0.0-20210514084401-e8d321eab015 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
80 changes: 23 additions & 57 deletions go.sum

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions manager.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package consoledog

import (
"context"
"sync"
"time"

Expand Down Expand Up @@ -49,12 +50,16 @@ type tHelper interface {

// RegisterContext register console Manager to test context.
func (m *Manager) RegisterContext(ctx *godog.ScenarioContext) {
ctx.BeforeScenario(func(sc *godog.Scenario) {
ctx.Before(func(_ context.Context, sc *godog.Scenario) (context.Context, error) {
m.NewConsole(sc)

return nil, nil
})

ctx.AfterScenario(func(sc *godog.Scenario, _ error) {
ctx.After(func(_ context.Context, sc *godog.Scenario, _ error) (context.Context, error) {
m.CloseConsole(sc)

return nil, nil
})

ctx.Step(`console output is:`, m.isConsoleOutput)
Expand Down

0 comments on commit ce1ba21

Please sign in to comment.