Skip to content

Commit 3226d21

Browse files
authored
Merge pull request #519 from gphotosuploader/update-golangci
Update golangci
2 parents bb4466c + 8a599f1 commit 3226d21

11 files changed

Lines changed: 37 additions & 25 deletions

File tree

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
env:
1414
# it should match the version in the Makefile file.
15-
GOLANGCI_LINT_VERSION: 'v1.64.5'
15+
GOLANGCI_LINT_VERSION: 'v2.1.6'
1616

1717
jobs:
1818
golangci:
@@ -24,6 +24,6 @@ jobs:
2424
with:
2525
go-version: 'stable'
2626
- name: golangci-lint
27-
uses: golangci/golangci-lint-action@v6
27+
uses: golangci/golangci-lint-action@v8
2828
with:
2929
version: ${{ env.GOLANGCI_LINT_VERSION }}

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/).
55

6+
## 5.0.2
7+
### Changed
8+
- Bump `github.com/spf13/afero` to v1.14.0
9+
- Bump `github.com/gphotosuploader/google-photos-api-client-go/v3` to v3.0.8
10+
- Bump `github.com/hjson/hjson-go/v4` to v4.5.0
11+
- Bump `github.com/int128/oauth2cli` to v1.17.0
12+
- Bump `golang.org/x/oauth2` to v0.30.0
13+
- Bump `golang.org/x/sync` to v0.14.0
14+
- Bump `golang.org/x/term` to v0.32.0
15+
- Bump `golang.org/x/text` to v0.25.0
16+
- [CI] Bump `golangci-lint` to v2.1.6
17+
618
## 5.0.1
719
### Added
820
- Support for go v1.24

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ TMP_DIR ?= .tmp
1818
COVERAGE_FILE := $(TMP_DIR)/coverage.txt
1919
COVERAGE_HTML_FILE := $(TMP_DIR)/coverage.html
2020
GOLANGCI := $(TMP_DIR)/golangci-lint
21-
GOLANGCI_VERSION := 1.64.5
21+
GOLANGCI_VERSION := 2.1.6
2222

2323
# set how to open files based on OS and ARCH.
2424
UNAME_OS := $(shell uname -s)

internal/cli/list/list_albums.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (o *ListAlbumsCommandOptions) Run(cobraCmd *cobra.Command, args []string) e
107107

108108
func (o *ListAlbumsCommandOptions) printAlbumsList(a []albums.Album, writer io.Writer) {
109109
if len(a) == 0 {
110-
fmt.Fprintln(writer, "No albums were found!")
110+
fmt.Fprintln(writer, "No albums were found!") //nolint:errcheck
111111
return
112112
}
113113

@@ -118,16 +118,16 @@ func (o *ListAlbumsCommandOptions) printAsTable(a []albums.Album, writer io.Writ
118118
w := tabwriter.NewWriter(writer, 0, 0, 1, ' ', 0)
119119

120120
if !o.NoHeaders {
121-
fmt.Fprintln(w, "TITLE\t ITEMS\t ID\t")
121+
fmt.Fprintln(w, "TITLE\t ITEMS\t ID\t") //nolint:errcheck
122122
}
123123

124124
for _, album := range a {
125-
fmt.Fprintf(w, "%s\t %d\t %s\t\n", album.Title, album.TotalMediaItems, album.ID)
125+
fmt.Fprintf(w, "%s\t %d\t %s\t\n", album.Title, album.TotalMediaItems, album.ID) //nolint:errcheck
126126
}
127127

128128
if !o.NoHeaders {
129-
fmt.Fprintf(w, "Total: %d albums.\n", len(a))
129+
fmt.Fprintf(w, "Total: %d albums.\n", len(a)) //nolint:errcheck
130130
}
131131

132-
w.Flush()
132+
w.Flush() //nolint:errcheck
133133
}

internal/cli/list/list_media.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ func (o *ListMediaItemsCommandOptions) Run(cobraCmd *cobra.Command, args []strin
118118

119119
func (o *ListMediaItemsCommandOptions) printMediaItemsList(mi []media_items.MediaItem, writer io.Writer) {
120120
if o.AlbumID != "" {
121-
fmt.Fprintf(writer, "Listing media items for album ID: %s\n", o.AlbumID)
121+
fmt.Fprintf(writer, "Listing media items for album ID: %s\n", o.AlbumID) //nolint:errcheck
122122
}
123123

124124
if len(mi) == 0 {
125-
fmt.Fprintln(writer, "No media items were found!")
125+
fmt.Fprintln(writer, "No media items were found!") //nolint:errcheck
126126
return
127127
}
128128

@@ -133,16 +133,16 @@ func (o *ListMediaItemsCommandOptions) printAsTable(mi []media_items.MediaItem,
133133
w := tabwriter.NewWriter(writer, 0, 0, 1, ' ', 0)
134134

135135
if !o.NoHeaders {
136-
fmt.Fprintln(w, "FILENAME\t MIME-TYPE\t ID\t")
136+
fmt.Fprintln(w, "FILENAME\t MIME-TYPE\t ID\t") //nolint:errcheck
137137
}
138138

139139
for _, mediaItem := range mi {
140-
fmt.Fprintf(w, "%s\t %s\t %s\t\n", mediaItem.Filename, mediaItem.MimeType, mediaItem.ID)
140+
fmt.Fprintf(w, "%s\t %s\t %s\t\n", mediaItem.Filename, mediaItem.MimeType, mediaItem.ID) //nolint:errcheck
141141
}
142142

143143
if !o.NoHeaders {
144-
fmt.Fprintf(w, "Total: %d media items.\n", len(mi))
144+
fmt.Fprintf(w, "Total: %d media items.\n", len(mi)) //nolint:errcheck
145145
}
146146

147-
w.Flush()
147+
w.Flush() //nolint:errcheck
148148
}

internal/datastore/tokenmanager/tokenmanager_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func equalTokens(want, in oauth2.Token) bool {
130130
if want.AccessToken == in.AccessToken &&
131131
want.RefreshToken == in.RefreshToken &&
132132
want.TokenType == in.TokenType &&
133-
want.Expiry == in.Expiry {
133+
want.Expiry.Equal(in.Expiry) {
134134
return true
135135
}
136136
return false

internal/datastore/upload_tracker/leveldb_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestLevelDBStore_GetSet(t *testing.T) {
5454

5555
got, found := store.Get("fooKey")
5656

57-
if !found || "fooValue" != got {
57+
if !found || got != "fooValue" {
5858
t.Errorf("want: %s, got: %s", "fooValue", got)
5959
}
6060
})

internal/feedback/feedback.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ func Printf(format string, v ...interface{}) {
6464

6565
// Print behaves like fmt.Print but writes on the out writer and adds a newline.
6666
func Print(v string) {
67-
fmt.Fprintln(feedbackOut, v)
67+
fmt.Fprintln(feedbackOut, v) //nolint:errcheck
6868
}
6969

7070
// Warning outputs a warning message.
7171
func Warning(msg string) {
72-
fmt.Fprintln(feedbackErr, msg)
72+
fmt.Fprintln(feedbackErr, msg) //nolint:errcheck
7373
logrus.Warning(msg)
7474
}
7575

@@ -86,7 +86,7 @@ func FatalResult(res ErrorResult, exitCode ExitCode) {
8686

8787
// Fatal outputs the errorMsg and exits with status exitCode.
8888
func Fatal(errorMsg string, exitCode ExitCode) {
89-
fmt.Fprintln(stdErr, errorMsg)
89+
fmt.Fprintln(stdErr, errorMsg) //nolint:errcheck
9090
os.Exit(int(exitCode))
9191
}
9292

@@ -99,9 +99,9 @@ func PrintResult(res Result) {
9999
dataErr = resErr.ErrorString()
100100
}
101101
if data != "" {
102-
fmt.Fprintln(stdOut, data)
102+
fmt.Fprintln(stdOut, data) //nolint:errcheck
103103
}
104104
if dataErr != "" {
105-
fmt.Fprintln(stdErr, dataErr)
105+
fmt.Fprintln(stdErr, dataErr) //nolint:errcheck
106106
}
107107
}

internal/feedback/terminal.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ func InputUserField(prompt string, secret bool) (string, error) {
3030

3131
// printPrompt prints the prompt to the user.
3232
func printPrompt(prompt string) {
33-
fmt.Fprintf(stdOut, "%s: ", prompt)
33+
fmt.Fprintf(stdOut, "%s: ", prompt) //nolint:errcheck
3434
}
3535

3636
// readPassword reads and returns a password from the user.
3737
func readPassword() (string, error) {
3838
value, err := term.ReadPassword(int(os.Stdin.Fd()))
39-
fmt.Fprintln(stdOut)
39+
fmt.Fprintln(stdOut) //nolint:errcheck
4040
return string(value), err
4141
}
4242

internal/upload/album.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func handleQuotesParsing(preFix, template, functionName string) (string, int, er
219219
}
220220

221221
if strings.TrimSpace(postFix) != "" || strings.TrimSpace(preFix) != "" {
222-
return "", 0, fmt.Errorf("Can't mix quoted & unquoted content in function arg: %s", functionName)
222+
return "", 0, fmt.Errorf("can't mix quoted & unquoted content in function arg: %s", functionName)
223223
}
224224

225225
return output, length + 1, nil

0 commit comments

Comments
 (0)