Skip to content

Commit 349f09b

Browse files
committed
chore: update Go, linter, and clean
1 parent c5297e1 commit 349f09b

File tree

6 files changed

+23
-58
lines changed

6 files changed

+23
-58
lines changed

.github/workflows/ci.yml

+7-16
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,23 @@ jobs:
1212
name: Main Process
1313
runs-on: ubuntu-latest
1414
env:
15-
GO_VERSION: '1.20'
16-
GOLANGCI_LINT_VERSION: v1.53.3
15+
GO_VERSION: stable
16+
GOLANGCI_LINT_VERSION: v1.54.2
1717
CGO_ENABLED: 0
1818

1919
steps:
2020

21-
# https://github.com/marketplace/actions/setup-go-environment
22-
- name: Set up Go ${{ env.GO_VERSION }}
23-
uses: actions/setup-go@v2
24-
with:
25-
go-version: ${{ env.GO_VERSION }}
26-
2721
# https://github.com/marketplace/actions/checkout
2822
- name: Check out code
29-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
3024
with:
3125
fetch-depth: 0
3226

33-
# https://github.com/marketplace/actions/cache
34-
- name: Cache Go modules
35-
uses: actions/cache@v3
27+
# https://github.com/marketplace/actions/setup-go-environment
28+
- name: Set up Go ${{ env.GO_VERSION }}
29+
uses: actions/setup-go@v4
3630
with:
37-
path: ~/go/pkg/mod
38-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
39-
restore-keys: |
40-
${{ runner.os }}-go-
31+
go-version: ${{ env.GO_VERSION }}
4132

4233
- name: Check and get dependencies
4334
run: |

.github/workflows/go-cross.yml

+6-23
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,20 @@ jobs:
1515

1616
strategy:
1717
matrix:
18-
go-version: [ '1.20', 1.x ]
18+
go-version: [ stable, oldstable ]
1919
os: [ubuntu-latest, macos-latest, windows-latest]
2020

2121
steps:
22-
# https://github.com/marketplace/actions/setup-go-environment
23-
- name: Set up Go ${{ matrix.go-version }}
24-
uses: actions/setup-go@v2
25-
with:
26-
go-version: ${{ matrix.go-version }}
2722

2823
# https://github.com/marketplace/actions/checkout
2924
- name: Checkout code
30-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
3126

32-
# https://github.com/marketplace/actions/cache
33-
- name: Cache Go modules
34-
uses: actions/cache@v3
27+
# https://github.com/marketplace/actions/setup-go-environment
28+
- name: Set up Go ${{ matrix.go-version }}
29+
uses: actions/setup-go@v4
3530
with:
36-
# In order:
37-
# * Module download cache
38-
# * Build cache (Linux)
39-
# * Build cache (Mac)
40-
# * Build cache (Windows)
41-
path: |
42-
~/go/pkg/mod
43-
~/.cache/go-build
44-
~/Library/Caches/go-build
45-
%LocalAppData%\go-build
46-
key: ${{ runner.os }}-${{ matrix.go-version }}-go-${{ hashFiles('**/go.sum') }}
47-
restore-keys: |
48-
${{ runner.os }}-${{ matrix.go-version }}-go-
31+
go-version: ${{ matrix.go-version }}
4932

5033
- name: Test
5134
run: go test -v -cover ./...

.github/workflows/release.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ jobs:
99
name: Release Process
1010
runs-on: ubuntu-latest
1111
env:
12-
GO_VERSION: '1.20'
12+
GO_VERSION: stable
1313
CGO_ENABLED: 0
1414

1515
steps:
1616

17-
# https://github.com/marketplace/actions/setup-go-environment
18-
- name: Set up Go ${{ env.GO_VERSION }}
19-
uses: actions/setup-go@v2
20-
with:
21-
go-version: ${{ env.GO_VERSION }}
22-
2317
# https://github.com/marketplace/actions/checkout
2418
- name: Check out code
25-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2620
with:
2721
fetch-depth: 0
2822

23+
# https://github.com/marketplace/actions/setup-go-environment
24+
- name: Set up Go ${{ env.GO_VERSION }}
25+
uses: actions/setup-go@v4
26+
with:
27+
go-version: ${{ env.GO_VERSION }}
28+
2929
# https://goreleaser.com/ci/actions/
3030
- name: Run GoReleaser
3131
uses: goreleaser/goreleaser-action@v2

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ Correct commonly misspelled English words... quickly.
1010
If you just want a binary and to start using `misspell`:
1111

1212
```bash
13-
curl -L -o ./install-misspell.sh https://git.io/misspell
14-
sh ./install-misspell.sh
13+
url -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b ./bin ${MISSSPELL_VERSION}
1514
```
1615

1716
Both will install as `./bin/misspell`.
@@ -25,17 +24,14 @@ Otherwise, install `misspell` the old-fashioned way:
2524
go install github.com/golangci/misspell/cmd/misspell@latest
2625
```
2726

28-
and misspell will be in your `GOPATH`.
29-
3027
Also, if you like to live dangerously, one could do
3128

3229
```bash
33-
curl -L https://git.io/misspell | bash
30+
url -sfL https://raw.githubusercontent.com/golangci/misspell/master/install-misspell.sh | sh -s -- -b $(go env GOPATH)/bin ${MISSSPELL_VERSION}
3431
```
3532

3633
### Usage
3734

38-
3935
```bash
4036
$ misspell all.html your.txt important.md files.go
4137
your.txt:42:10 found "langauge" a misspelling of "language"

goreleaser.yml

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ builds:
1616

1717
archives:
1818
- name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
19-
replacements:
20-
amd64: 64bit
21-
386: 32bit
22-
darwin: mac
2319
files:
2420
- LICENSE
2521

stringreplacer.go

-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ func (r *genericReplacer) Replace(s string) string {
242242
return string(buf)
243243
}
244244

245-
//nolint:gocognit // TODO(ldez) must be fixed.
246245
func (r *genericReplacer) WriteString(w io.Writer, s string) (n int, err error) {
247246
sw := getStringWriter(w)
248247
var last, wn int

0 commit comments

Comments
 (0)