Skip to content

Commit dd35d01

Browse files
committed
Golang 1.22 upgrade
1 parent 4944eaa commit dd35d01

File tree

15 files changed

+197
-18
lines changed

15 files changed

+197
-18
lines changed

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k="
2+
3+
use devenv

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: 1.21
22+
go-version: 1.22
2323

2424
- name: Draft release notes
2525
uses: release-drafter/[email protected]

.github/workflows/tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v5
1818
with:
19-
go-version: 1.21
19+
go-version: 1.22
2020

2121
- name: Check out the repository
2222
uses: actions/checkout@v4
@@ -26,7 +26,7 @@ jobs:
2626
- name: Run golangci-lint
2727
uses: golangci/[email protected]
2828
with:
29-
version: v1.45.0
29+
version: v1.62.2
3030
args: --timeout=3m
3131
skip-go-installation: true
3232

@@ -37,9 +37,9 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
include:
40-
- { go: "1.21", os: "ubuntu-latest" }
41-
- { go: "1.21", os: "macos-latest" }
42-
- { go: "1.21", os: "windows-latest" }
40+
- { go: "1.22", os: "ubuntu-latest" }
41+
- { go: "1.22", os: "macos-latest" }
42+
- { go: "1.22", os: "windows-latest" }
4343

4444
steps:
4545
- name: Check out the repository
@@ -67,7 +67,7 @@ jobs:
6767
- name: Set up Go
6868
uses: actions/setup-go@v5
6969
with:
70-
go-version: "1.21"
70+
go-version: "1.22"
7171

7272
- name: Run coverage
7373
run: go test ./... -failfast -race -coverprofile=coverage.out -covermode=atomic

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ coverage*
77
.vscode/
88

99
dist/
10+
# Devenv
11+
.devenv*
12+
devenv.local.nix
13+
14+
# direnv
15+
.direnv
16+
17+
# pre-commit
18+
.pre-commit-config.yaml

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
run:
3-
go: "1.21"
3+
go: "1.22"
44
linters:
55
enable:
66
- thelper

.goreleaser.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
version: 2
23
builds:
34
- env:
45
- CGO_ENABLED=0
@@ -31,7 +32,7 @@ archives:
3132
checksum:
3233
name_template: "checksums.txt"
3334
snapshot:
34-
name_template: "{{ incpatch .Version }}-next"
35+
version_template: "{{ incpatch .Version }}-next"
3536
changelog:
3637
sort: asc
3738
filters:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Prerequisites:
88

99
- [Task](https://taskfile.dev/#/installation)
10-
- [Go 1.21+](https://golang.org/doc/install)
10+
- [Go 1.22+](https://golang.org/doc/install)
1111

1212
Clone `cleancontacts`:
1313

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Export your contacts in VCard format and run the program. BANG! You have a new V
1010

1111
Download the relevant binary on Assets of latest [release](https://github.com/staticdev/cleancontacts/releases).
1212

13-
Alternatively, if you have golang 1.21+ installed:
13+
Alternatively, if you have golang 1.22+ installed:
1414

1515
```sh
1616
go install github.com/staticdev/cleancontacts

clean/clean.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ func (Clean) ContactClean(fileSystem afero.Fs, fileNameIn, filePathOut string) e
4141
card, err := dec.Decode()
4242
if err == io.EOF {
4343
break
44-
} else {
45-
errs = handleError(err, errs)
4644
}
45+
errs = handleError(err, errs)
4746
ns := card.Values("N")
4847
tels := card.Values("TEL")
4948

cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Export your contacts in VCard format and run the program. BANG! You have a new V
3333
Version: "0.3.0",
3434
Example: `cleancontacts contacts.vcf
3535
cleancontacts /path/contacts.vcf`,
36-
RunE: func(cmd *cobra.Command, args []string) error {
36+
RunE: func(_ *cobra.Command, args []string) error {
3737
if len(args) != 1 {
3838
return CommandError{Msg: "Contact file argument not provided."}
3939
}

0 commit comments

Comments
 (0)