Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use golanglint-ci instead of golint #19

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -19,7 +20,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