Skip to content

Commit

Permalink
Merge pull request #19 from moznion/use_golangci-lint
Browse files Browse the repository at this point in the history
Use golanglint-ci instead of golint
  • Loading branch information
moznion authored Aug 23, 2022
2 parents 3e691f0 + aeac609 commit d005659
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
- name: Install go toolchains
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/lint/golint@latest
- name: Do test
run: make check
run: make check-ci
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest

4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ REVISION=$(shell git rev-parse --verify HEAD)
INTERNAL_PACKAGE=github.com/moznion/gonstructor/internal

check: test lint vet fmt-check
check-ci: test vet fmt-check

build4test: clean
mkdir -p $(RELEASE_DIR)
Expand All @@ -18,7 +19,8 @@ test: gen4test
go test -v $(PKGS)

lint:
golint -set_exit_status $(PKGS_WITHOUT_TEST)
lint:
golangci-lint run ./...

vet:
go vet $(PKGS)
Expand Down
1 change: 0 additions & 1 deletion internal/test/init_return_propagation/structure.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ func (s *StructureWithInitFoo) initialize() {
}

func (s StructureWithInitBar) initializeWithActualValueReceiver() {
s.checked = true
}

func (s *StructureWithInitBuz) initializeWithError() error {
Expand Down
6 changes: 3 additions & 3 deletions internal/test/structure_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestStructureAllArgsConstructor(t *testing.T) {
givenString := "givenstr"
givenIOReader := strings.NewReader(givenString)
givenChan := make(chan interface{}, 0)
givenChan := make(chan interface{})

got := NewStructure(givenString, givenIOReader, givenChan)
assert.IsType(t, &Structure{}, got)
Expand All @@ -30,7 +30,7 @@ func TestStructureAllArgsConstructor(t *testing.T) {
func TestStructureBuilder(t *testing.T) {
givenString := "givenstr"
givenIOReader := strings.NewReader(givenString)
givenChan := make(chan interface{}, 0)
givenChan := make(chan interface{})

b := NewStructureBuilder()
got := b.Foo(givenString).
Expand All @@ -46,7 +46,7 @@ func TestStructureBuilder(t *testing.T) {
}

func TestChildStructureAllArgsConstructor(t *testing.T) {
structure := NewStructure("givenstr", strings.NewReader("givenstr"), make(chan interface{}, 0))
structure := NewStructure("givenstr", strings.NewReader("givenstr"), make(chan interface{}))
givenString := "foobar"

got := NewChildStructure(structure, givenString)
Expand Down

0 comments on commit d005659

Please sign in to comment.