Skip to content

Commit 354f8da

Browse files
committed
Add "modernize" linter
1 parent 5253677 commit 354f8da

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

.golangci.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ formatters:
1010
- "goimports"
1111

1212
settings:
13+
gofumpt:
14+
# Choose whether to use the extra rules.
15+
# Default: false
16+
extra-rules: true
17+
1318
goimports:
1419
# A list of prefixes, which, if set, checks import paths
1520
# with the given prefixes are grouped after 3rd-party packages.
@@ -22,10 +27,12 @@ linters:
2227
- "asciicheck"
2328
- "bidichk"
2429
- "copyloopvar"
30+
- "embeddedstructfieldcheck"
2531
- "errorlint"
2632
- "gocritic"
2733
- "makezero"
2834
- "misspell"
35+
- "modernize"
2936
- "nilnesserr"
3037
- "nolintlint"
3138
- "perfsprint"
@@ -51,6 +58,10 @@ linters:
5158
- "(net.Conn).Close"
5259
- "(*os.File).Close"
5360

61+
# Display function signature instead of selector.
62+
# Default: false
63+
verbose: true
64+
5465
nolintlint:
5566
# Enable to require an explanation of nonzero length after each nolint
5667
# directive.

cmd/folders.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (self *FoldersCheck) folderError(ctx context.Context, folderId string,
150150
} else if len(fileErrors) > 0 {
151151
folderError = fileErrors[len(fileErrors)-1]
152152
}
153-
return
153+
return folderError, err
154154
}
155155

156156
func (self *FoldersCheck) fetchCompletions(ctx context.Context,
@@ -189,13 +189,13 @@ func (self *FoldersCheck) numCompletions() int {
189189

190190
func (self *FoldersCheck) completion(ctx context.Context,
191191
folder *api.FolderConfiguration, deviceId string,
192-
) (comp *api.FolderCompletion, err error) {
193-
comp, err = self.client.Completion(ctx, folder.Id, deviceId)
192+
) (*api.FolderCompletion, error) {
193+
comp, err := self.client.Completion(ctx, folder.Id, deviceId)
194194
if err != nil {
195195
err = fmt.Errorf("completion folder=%q, device=%q: %w",
196196
folderName(folder), self.deviceName(deviceId), err)
197197
}
198-
return
198+
return comp, err
199199
}
200200

201201
func (self *FoldersCheck) deviceName(id string) string {

cmd/seen.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (self *LastSeenCheck) oldest() (deviceId string, seen time.Time) {
170170
}
171171
}
172172
}
173-
return
173+
return deviceId, seen
174174
}
175175

176176
func (self *LastSeenCheck) output(deviceId string, lastSeen time.Duration) {

0 commit comments

Comments
 (0)