Skip to content

Commit 6e9c083

Browse files
committed
devices/config: replace omitempty with omitzero
This is technically a no-op, but let's change it for consistency. While at it, move linter-extra exceptions to golangci-extra.yml. Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 10c8b57 commit 6e9c083

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.golangci-extra.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ linters:
2525
text: "(type|struct field) (CpuUsage|CpuStats) should be "
2626
- path: config_linux.go
2727
text: "struct field (CpuShares|CpuQuota|CpuBurst|CpuPeriod|CpuRtRuntime|CpuWeight) should be "
28+
- path: devices/config/device.go
29+
text: "struct field (Uid|Gid) should be "

devices/config/device.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ type Device struct {
2020
FileMode os.FileMode `json:"file_mode"`
2121

2222
// Uid of the device.
23-
Uid uint32 `json:"uid,omitempty"` //nolint:revive // Suppress "var-naming: struct field Uid should be UID".
23+
Uid uint32 `json:"uid,omitzero"`
2424

2525
// Gid of the device.
26-
Gid uint32 `json:"gid,omitempty"` //nolint:revive // Suppress "var-naming: struct field Gid should be GID".
26+
Gid uint32 `json:"gid,omitzero"`
2727
}
2828

2929
// Permissions is a cgroupv1-style string to represent device access. It

0 commit comments

Comments
 (0)