Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
CMGS committed May 15, 2023
1 parent 86f7f62 commit 28d74ad
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion logs/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type discard struct {
}

// Write writer
func (d discard) Write(p []byte) (n int, err error) {
func (d discard) Write([]byte) (n int, err error) {
return 0, nil
}

Expand Down
6 changes: 3 additions & 3 deletions runtime/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ func (d *Docker) AttachWorkload(ctx context.Context, ID string) (io.Reader, io.R
return nil, nil, err
}

cap, _ := units.RAMInBytes("10M")
outr, outw := utils.NewBufPipe(cap)
errr, errw := utils.NewBufPipe(cap)
capacity, _ := units.RAMInBytes("10M")
outr, outw := utils.NewBufPipe(capacity)
errr, errw := utils.NewBufPipe(capacity)

_ = utils.Pool.Submit(func() {
defer func() {
Expand Down
4 changes: 2 additions & 2 deletions runtime/docker/stat_notlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/shirou/gopsutil/net"
)

func getStats(ctx context.Context, ID string, pid int, proc string) (*docker.CgroupCPUStat, cpu.TimesStat, []net.IOCountersStat, error) {
func getStats(ctx context.Context, _ string, _ int, _ string) (*docker.CgroupCPUStat, cpu.TimesStat, []net.IOCountersStat, error) {
containerCPUStats := &docker.CgroupCPUStat{
TimesStat: cpu.TimesStat{},
Usage: 0.0,
Expand All @@ -26,6 +26,6 @@ func getStats(ctx context.Context, ID string, pid int, proc string) (*docker.Cgr
return containerCPUStats, systemCPUStats, []net.IOCountersStat{}, nil
}

func getMemStats(ctx context.Context, ID string) (*docker.CgroupMemStat, error) {
func getMemStats(context.Context, string) (*docker.CgroupMemStat, error) {
return &docker.CgroupMemStat{}, nil
}
8 changes: 4 additions & 4 deletions runtime/yavirt/yavirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ func (y *Yavirt) detectWorkload(ctx context.Context, ID string) (*Guest, error)
}

// AttachWorkload not implemented yet
func (y *Yavirt) AttachWorkload(ctx context.Context, ID string) (io.Reader, io.Reader, error) {
func (y *Yavirt) AttachWorkload(context.Context, string) (io.Reader, io.Reader, error) {
return nil, nil, common.ErrNotImplemented
}

// CollectWorkloadMetrics no need yet
func (y *Yavirt) CollectWorkloadMetrics(ctx context.Context, ID string) {}
func (y *Yavirt) CollectWorkloadMetrics(context.Context, string) {}

// ListWorkloadIDs lists workload IDs filtered by given condition
func (y *Yavirt) ListWorkloadIDs(ctx context.Context, filters map[string]string) (ids []string, err error) {
Expand Down Expand Up @@ -199,12 +199,12 @@ func (y *Yavirt) GetStatus(ctx context.Context, ID string, checkHealth bool) (*t
}

// GetWorkloadName not implemented yet
func (y *Yavirt) GetWorkloadName(ctx context.Context, ID string) (string, error) {
func (y *Yavirt) GetWorkloadName(context.Context, string) (string, error) {
return "", common.ErrNotImplemented
}

// LogFieldsExtra .
func (y *Yavirt) LogFieldsExtra(ctx context.Context, ID string) (map[string]string, error) {
func (y *Yavirt) LogFieldsExtra(context.Context, string) (map[string]string, error) {
return map[string]string{}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion utils/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (r *RetryTask) Run(ctx context.Context) error {
}

// Stop stops running task
func (r *RetryTask) Stop(ctx context.Context) {
func (r *RetryTask) Stop(context.Context) {
r.cancel()
}

Expand Down
2 changes: 1 addition & 1 deletion utils/udev_notlinux.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

package utils

func GetDevicePath(major, minor uint64) (devPath string, err error) {
func GetDevicePath(uint64, uint64) (devPath string, err error) {
return "/dev/random", nil
}

0 comments on commit 28d74ad

Please sign in to comment.