Skip to content

Commit 529de38

Browse files
authored
Merge pull request #1947 from alexandear/linter-enable-nolintlint-gosimple-bodyclose
.golangci.yml: enable and fix nolintlint, bodyclose, gosimple
2 parents 84bbfb0 + bf2c37f commit 529de38

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

.golangci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ linters:
3232
# - prealloc
3333
- typecheck
3434
# - asciicheck
35-
# - bodyclose
35+
- bodyclose
3636
# - dogsled
3737
# - dupl
3838
# - errcheck
@@ -58,14 +58,14 @@ linters:
5858
# - gomodguard
5959
# - goprintffuncname
6060
# - gosec (gas)
61-
# - gosimple (megacheck)
61+
- gosimple
6262
# - interfacer
6363
# - lll
6464
# - maligned
6565
# - nestif
6666
# - nlreturn
6767
# - noctx
68-
# - nolintlint
68+
- nolintlint
6969
# - rowserrcheck
7070
# - scopelint
7171
# - sqlclosecheck

cmd/limactl/edit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func editAction(cmd *cobra.Command, args []string) error {
8585
logrus.Info("Aborting, as requested by saving the file with empty content")
8686
return nil
8787
}
88-
if bytes.Compare(yBytes, yContent) == 0 {
88+
if bytes.Equal(yBytes, yContent) {
8989
logrus.Info("Aborting, no changes made to the instance")
9090
return nil
9191
}

pkg/osutil/osutil_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const UnixPathMax = 108
1111
// Stat is a selection of syscall.Stat_t
1212
type Stat struct {
1313
Uid uint32 //nolint:revive
14-
Gid uint32 //nolint:revive
14+
Gid uint32
1515
}
1616

1717
func SysStat(fi fs.FileInfo) (Stat, bool) {

pkg/osutil/osutil_others.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const UnixPathMax = 104
1414
// Stat is a selection of syscall.Stat_t
1515
type Stat struct {
1616
Uid uint32 //nolint:revive
17-
Gid uint32 //nolint:revive
17+
Gid uint32
1818
}
1919

2020
func SysStat(fi fs.FileInfo) (Stat, bool) {

pkg/osutil/osutil_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const UnixPathMax = 108
1414
// Stat is a selection of syscall.Stat_t
1515
type Stat struct {
1616
Uid uint32 //nolint:revive
17-
Gid uint32 //nolint:revive
17+
Gid uint32
1818
}
1919

2020
func SysStat(_ fs.FileInfo) (Stat, bool) {

pkg/osutil/user.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ type User struct {
1818
User string
1919
Uid uint32 //nolint:revive
2020
Group string
21-
Gid uint32 //nolint:revive
21+
Gid uint32
2222
Home string
2323
}
2424

2525
type Group struct {
2626
Name string
27-
Gid uint32 //nolint:revive
27+
Gid uint32
2828
}
2929

3030
var users map[string]User
@@ -77,7 +77,7 @@ func LookupGroup(name string) (Group, error) {
7777
const (
7878
fallbackUser = "lima"
7979
fallbackUid = 1000 //nolint:revive
80-
fallbackGid = 1000 //nolint:revive
80+
fallbackGid = 1000
8181
)
8282

8383
var cache struct {

0 commit comments

Comments
 (0)