From 10d03c825eb2646c008596206e962b96b5be0e13 Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 30 May 2020 16:07:45 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BD=BF=E7=94=A8gomod=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0golangci-lint=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/go.yml | 6 +++--- go.mod | 11 +++++++++++ go.sum | 11 +++++++++++ vendor/vendor.json | 25 ------------------------- 4 files changed, 25 insertions(+), 28 deletions(-) create mode 100644 go.mod create mode 100644 go.sum delete mode 100644 vendor/vendor.json diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 693267f..5502570 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,5 +1,5 @@ name: Go -on: [push] +on: [push,pull_request] jobs: build: @@ -23,9 +23,9 @@ jobs: curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh dep ensure fi - + - name: Run golangci-lint uses: golangci/golangci-lint-action@v1.2.1 - + - name: Build run: go build -v . diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..c9da8eb --- /dev/null +++ b/go.mod @@ -0,0 +1,11 @@ +module github.com/silenceper/gowatch + +go 1.14 + +require ( + github.com/howeyc/fsnotify v0.9.0 + github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect + github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect + gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..3f76568 --- /dev/null +++ b/go.sum @@ -0,0 +1,11 @@ +github.com/howeyc/fsnotify v0.9.0 h1:0gtV5JmOKH4A8SsFxG2BczSeXWWPvcMT0euZt5gDAxY= +github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/silenceper/log v0.0.0-20171204144354-e5ac7fa8a76a/go.mod h1:nyN/YUSK3CgJjtNzm6dVTkcou+RYXNMP+XLSlzQu0m0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0 h1:POO/ycCATvegFmVuPpQzZFJ+pGZeX22Ufu6fibxDVjU= +gopkg.in/yaml.v1 v1.0.0-20140924161607-9f9df34309c0/go.mod h1:WDnlLJ4WF5VGsH/HVa3CI79GS0ol3YnhVnKP89i0kNg= diff --git a/vendor/vendor.json b/vendor/vendor.json deleted file mode 100644 index 06de7df..0000000 --- a/vendor/vendor.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "comment": "", - "ignore": "test", - "package": [ - { - "checksumSHA1": "ZxzYc1JwJ3U6kZbw/KGuPko5lSY=", - "path": "github.com/howeyc/fsnotify", - "revision": "f0c08ee9c60704c1879025f2ae0ff3e000082c13", - "revisionTime": "2015-10-03T19:46:02Z" - }, - { - "checksumSHA1": "vu02Mae/2hEatndbEFW3Z0rKVRs=", - "path": "github.com/silenceper/log", - "revision": "e5ac7fa8a76a863e90c8b624d5c2d4cab8e48394", - "revisionTime": "2017-12-04T14:43:54Z" - }, - { - "checksumSHA1": "MGk7cSnHqiL5soaovzgcJaNH3fc=", - "path": "gopkg.in/yaml.v1", - "revision": "9f9df34309c04878acc86042b16630b0f696e1de", - "revisionTime": "2014-09-24T16:16:07Z" - } - ], - "rootPath": "github.com/silenceper/gowatch" -} From 2c671914b66a54c1bf74d98856ba5776aca369ad Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 30 May 2020 16:15:53 +0800 Subject: [PATCH 2/5] update github workflows --- .github/workflows/go.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 5502570..b07ec81 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -26,6 +26,7 @@ jobs: - name: Run golangci-lint uses: golangci/golangci-lint-action@v1.2.1 - + run: > + golangci-lint run - name: Build run: go build -v . From 557c9262bc3f9422acb41e8d8c1d9045f928facb Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 30 May 2020 16:20:05 +0800 Subject: [PATCH 3/5] update github workflows --- .github/workflows/go.yml | 46 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b07ec81..41549c9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,26 +7,32 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.13 - uses: actions/setup-go@v1 - with: - go-version: 1.13 - id: go + - name: Set up Go 1.x + uses: actions/setup-go@v2 + with: + go-version: ^1.13 + id: go - - name: Check out code into the Go module directory - uses: actions/checkout@v1 + - name: Check out code into the Go module directory + uses: actions/checkout@v2 - - name: Get dependencies - run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi + - name: Get dependencies + run: | + go get -v -t -d ./... + if [ -f Gopkg.toml ]; then + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh + dep ensure + fi - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v1.2.1 - run: > - golangci-lint run - - name: Build - run: go build -v . + - name: Lint Go Code + run: | + export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14 + go get -u golang.org/x/lint/golint + go vet ./... + golint -set_exit_status $(go list ./...) + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v1.2.1 + + - name: Build + run: go build -v . From 666321f783484291800a5400af1a747886aa1c65 Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 30 May 2020 16:28:59 +0800 Subject: [PATCH 4/5] Update go.yml --- .github/workflows/go.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 41549c9..8716a95 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,8 +31,12 @@ jobs: go vet ./... golint -set_exit_status $(go list ./...) - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v1.2.1 + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v1 + 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.26 - name: Build run: go build -v . From 5b58a4381ef386ca60abd5f04595fd8d3e93ae7b Mon Sep 17 00:00:00 2001 From: silenceper Date: Sat, 30 May 2020 22:06:49 +0800 Subject: [PATCH 5/5] update github workflows --- .github/workflows/go.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 41549c9..b7076e9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -31,8 +31,5 @@ jobs: go vet ./... golint -set_exit_status $(go list ./...) - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v1.2.1 - - name: Build run: go build -v .