Skip to content

Commit

Permalink
enable gofmt linter
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed May 31, 2024
1 parent 51919fd commit 2a604ff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ linters:
enable:
- errcheck
- godot
- gofmt
- gosimple
- govet
- ineffassign
Expand Down
10 changes: 5 additions & 5 deletions net_conntrackstat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestParseConntrackStat(t *testing.T) {
}

want := []ConntrackStatEntry{
ConntrackStatEntry{
{
Entries: 33,
Found: 0,
Invalid: 3,
Expand All @@ -45,7 +45,7 @@ func TestParseConntrackStat(t *testing.T) {
EarlyDrop: 0,
SearchRestart: 0,
},
ConntrackStatEntry{
{
Entries: 33,
Found: 0,
Invalid: 2,
Expand All @@ -56,7 +56,7 @@ func TestParseConntrackStat(t *testing.T) {
EarlyDrop: 0,
SearchRestart: 2,
},
ConntrackStatEntry{
{
Entries: 33,
Found: 0,
Invalid: 1,
Expand All @@ -67,7 +67,7 @@ func TestParseConntrackStat(t *testing.T) {
EarlyDrop: 0,
SearchRestart: 1,
},
ConntrackStatEntry{
{
Entries: 33,
Found: 0,
Invalid: 47,
Expand Down Expand Up @@ -96,7 +96,7 @@ func TestParseOldConntrackStat(t *testing.T) {
}

want := []ConntrackStatEntry{
ConntrackStatEntry{
{
Entries: 43,
Searched: 202143,
Found: 48658538,
Expand Down
10 changes: 5 additions & 5 deletions net_udp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Test_newNetUDP(t *testing.T) {
name: "udp file found, no error should come up",
file: "testdata/fixtures/proc/net/udp",
want: []*netIPSocketLine{
&netIPSocketLine{
{
Sl: 0,
LocalAddr: net.IP{10, 0, 0, 5},
LocalPort: 22,
Expand All @@ -43,7 +43,7 @@ func Test_newNetUDP(t *testing.T) {
Inode: 2740,
Drops: intToU64(100),
},
&netIPSocketLine{
{
Sl: 1,
LocalAddr: net.IP{0, 0, 0, 0},
LocalPort: 22,
Expand All @@ -56,7 +56,7 @@ func Test_newNetUDP(t *testing.T) {
Inode: 2740,
Drops: intToU64(100),
},
&netIPSocketLine{
{
Sl: 2,
LocalAddr: net.IP{0, 0, 0, 0},
LocalPort: 22,
Expand All @@ -76,7 +76,7 @@ func Test_newNetUDP(t *testing.T) {
name: "udp6 file found, no error should come up",
file: "testdata/fixtures/proc/net/udp6",
want: []*netIPSocketLine{
&netIPSocketLine{
{
Sl: 1315,
LocalAddr: net.IP{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
LocalPort: 5355,
Expand All @@ -89,7 +89,7 @@ func Test_newNetUDP(t *testing.T) {
Inode: 21040,
Drops: intToU64(0),
},
&netIPSocketLine{
{
Sl: 6073,
LocalAddr: net.IP{254, 128, 0, 0, 0, 0, 0, 0, 86, 225, 173, 255, 254, 124, 102, 9},
LocalPort: 51073,
Expand Down
6 changes: 3 additions & 3 deletions proc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ func TestFileDescriptorsInfo(t *testing.T) {
sort.Sort(fdinfos)
var want = ProcFDInfos{
ProcFDInfo{FD: "0", Pos: "0", Flags: "02004000", MntID: "13", InotifyInfos: []InotifyInfo{
InotifyInfo{WD: "3", Ino: "1", Sdev: "34", Mask: "fce"},
InotifyInfo{WD: "2", Ino: "1300016", Sdev: "fd00002", Mask: "fce"},
InotifyInfo{WD: "1", Ino: "2e0001", Sdev: "fd00000", Mask: "fce"},
{WD: "3", Ino: "1", Sdev: "34", Mask: "fce"},
{WD: "2", Ino: "1300016", Sdev: "fd00002", Mask: "fce"},
{WD: "1", Ino: "2e0001", Sdev: "fd00000", Mask: "fce"},
}},
ProcFDInfo{FD: "1", Pos: "0", Flags: "02004002", MntID: "13", InotifyInfos: nil},
ProcFDInfo{FD: "10", Pos: "0", Flags: "02004002", MntID: "9", InotifyInfos: nil},
Expand Down

0 comments on commit 2a604ff

Please sign in to comment.