Skip to content

Commit

Permalink
chore: enable unused-parameter from revive
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Jan 30, 2025
1 parent 90e5996 commit ccce57b
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ linters-settings:
disabled: true
- name: unreachable-code
- name: unused-parameter
disabled: true
- name: use-any
disabled: true
- name: var-declaration
- name: var-naming
disabled: true
testifylint:
enable-all: true
run:
timeout: 2m
2 changes: 1 addition & 1 deletion disk/disk_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"golang.org/x/sys/unix"
)

func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) {
func UsageWithContext(_ context.Context, path string) (*UsageStat, error) {
stat := unix.Statfs_t{}
err := unix.Statfs(path, &stat)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions docker/docker_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"testing"
)

func TestGetDockerIDList(t *testing.T) {
func TestGetDockerIDList(_ *testing.T) {
// If there is not docker environment, this test always fail.
// not tested here
/*
Expand All @@ -19,7 +19,7 @@ func TestGetDockerIDList(t *testing.T) {
*/
}

func TestGetDockerStat(t *testing.T) {
func TestGetDockerStat(_ *testing.T) {
// If there is not docker environment, this test always fail.
// not tested here

Expand Down
2 changes: 1 addition & 1 deletion docker/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"
)

func TestSysAdvancedDockerInfo(t *testing.T) {
func TestSysAdvancedDockerInfo(_ *testing.T) {
list, err := GetDockerIDList()
if err != nil {
fmt.Println(err)
Expand Down
4 changes: 2 additions & 2 deletions host/host_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func BootTimeWithContext(ctx context.Context) (uint64, error) {
return common.BootTimeWithContext(ctx, enableBootTimeCache)
}

func UptimeWithContext(ctx context.Context) (uint64, error) {
func UptimeWithContext(_ context.Context) (uint64, error) {
sysinfo := &unix.Sysinfo_t{}
if err := unix.Sysinfo(sysinfo); err != nil {
return 0, err
Expand Down Expand Up @@ -322,7 +322,7 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil
return platform, family, version, nil
}

func KernelVersionWithContext(ctx context.Context) (version string, err error) {
func KernelVersionWithContext(_ context.Context) (version string, err error) {
var utsname unix.Utsname
err = unix.Uname(&utsname)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (i FakeInvoke) Command(name string, arg ...string) ([]byte, error) {
return []byte{}, fmt.Errorf("could not find testdata: %s", fpath)
}

func (i FakeInvoke) CommandWithContext(ctx context.Context, name string, arg ...string) ([]byte, error) {
func (i FakeInvoke) CommandWithContext(_ context.Context, name string, arg ...string) ([]byte, error) {
return i.Command(name, arg...)
}

Expand Down
2 changes: 1 addition & 1 deletion net/net.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func Interfaces() (InterfaceStatList, error) {
return InterfacesWithContext(context.Background())
}

func InterfacesWithContext(ctx context.Context) (InterfaceStatList, error) {
func InterfacesWithContext(_ context.Context) (InterfaceStatList, error) {
is, err := net.Interfaces()
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion net/net_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func IOCountersWithContext(ctx context.Context, pernic bool) ([]IOCountersStat,
return IOCountersByFileWithContext(ctx, pernic, filename)
}

func IOCountersByFileWithContext(ctx context.Context, pernic bool, filename string) ([]IOCountersStat, error) {
func IOCountersByFileWithContext(_ context.Context, pernic bool, filename string) ([]IOCountersStat, error) {
lines, err := common.ReadLines(filename)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions process/process_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (p *Process) NiceWithContext(ctx context.Context) (int32, error) {
return nice, nil
}

func (p *Process) IOniceWithContext(ctx context.Context) (int32, error) {
func (p *Process) IOniceWithContext(_ context.Context) (int32, error) {
return 0, common.ErrNotImplementedError
}

Expand Down Expand Up @@ -310,7 +310,7 @@ func (p *Process) TimesWithContext(ctx context.Context) (*cpu.TimesStat, error)
return cpuTimes, nil
}

func (p *Process) CPUAffinityWithContext(ctx context.Context) ([]int32, error) {
func (p *Process) CPUAffinityWithContext(_ context.Context) ([]int32, error) {
return nil, common.ErrNotImplementedError
}

Expand Down
2 changes: 1 addition & 1 deletion process/process_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) {
return false, err
}

func (p *Process) SendSignalWithContext(ctx context.Context, sig syscall.Signal) error {
func (p *Process) SendSignalWithContext(_ context.Context, sig syscall.Signal) error {
process, err := os.FindProcess(int(p.Pid))
if err != nil {
return err
Expand Down

0 comments on commit ccce57b

Please sign in to comment.