Skip to content

Commit 2be717c

Browse files
committed
fix: address errcheck and staticcheck lint errors
1 parent 1d45a15 commit 2be717c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

internal/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func Execute(ctx context.Context) error {
4848
// Print update notice after command output
4949
if newRelease := <-updateCh; newRelease != nil {
5050
isHomebrew := update.IsUnderHomebrew()
51-
if !(isHomebrew && update.IsRecentRelease(newRelease.PublishedAt)) {
51+
if !isHomebrew || !update.IsRecentRelease(newRelease.PublishedAt) {
5252
fmt.Fprintf(os.Stderr, "\nA new release of cnap is available: %s → %s\n",
5353
strings.TrimPrefix(version, "v"),
5454
strings.TrimPrefix(newRelease.Version, "v"))

internal/update/update.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func fetchLatestRelease(ctx context.Context) (*ReleaseInfo, error) {
153153
}
154154
defer func() {
155155
_, _ = io.Copy(io.Discard, resp.Body)
156-
resp.Body.Close()
156+
_ = resp.Body.Close()
157157
}()
158158

159159
if resp.StatusCode != 200 {

0 commit comments

Comments
 (0)