From 4739c3411d158865784533792b1ea5dc6ec15cbc Mon Sep 17 00:00:00 2001 From: Clivern Date: Tue, 16 Mar 2021 11:24:35 +0100 Subject: [PATCH 1/2] Add goreleaser & a gh workflow --- .github/workflows/release.yml | 29 +++++++++++++++++++++++++++++ .goreleaser.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .goreleaser.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..46706f666 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - + name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000..ccd80bfaa --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,35 @@ +# This is an example goreleaser.yaml file with some sane defaults. +# Make sure to check the documentation at http://goreleaser.com +--- +archives: + - + replacements: + 386: i386 + amd64: x86_64 + darwin: Darwin + linux: Linux + windows: Windows +before: + hooks: + - "go mod download" + - "go generate ./..." +builds: + - + env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + - windows + +changelog: + filters: + exclude: + - "^docs:" + - "^test:" + sort: asc +checksum: + name_template: checksums.txt +snapshot: + name_template: "{{ .Tag }}-next" +project_name: revive From 45564abd80b2aa4d64a00c4a65b60a37833207f5 Mon Sep 17 00:00:00 2001 From: Clivern Date: Tue, 16 Mar 2021 21:14:55 +0100 Subject: [PATCH 2/2] format code --- rule/blank-imports.go | 4 ++-- rule/struct-tag.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rule/blank-imports.go b/rule/blank-imports.go index 5e93be3ae..9e8b8fc00 100644 --- a/rule/blank-imports.go +++ b/rule/blank-imports.go @@ -22,8 +22,8 @@ func (r *BlankImportsRule) Apply(file *lint.File, _ lint.Arguments) []lint.Failu } const ( - message = "a blank import should be only in a main or test package, or have a comment justifying it" - category = "imports" + message = "a blank import should be only in a main or test package, or have a comment justifying it" + category = "imports" embedImportPath = `"embed"` ) diff --git a/rule/struct-tag.go b/rule/struct-tag.go index 57cf8103a..cb3818e92 100644 --- a/rule/struct-tag.go +++ b/rule/struct-tag.go @@ -168,7 +168,7 @@ func (w lintStructTagRule) checkJSONTag(name string, options []string) (string, case "": // special case for JSON key "-" if name != "-" { - return "option can not be empty in JSON tag", false + return "option can not be empty in JSON tag", false } default: return fmt.Sprintf("unknown option '%s' in JSON tag", opt), false