Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go.{mod,sum}, .github: bump minimum golang version to 1.20. #88

Merged
merged 7 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
pkg/{adaptation,api,net,stub}: fix linter errors.
Signed-off-by: Krisztian Litkey <krisztian.litkey@intel.com>
  • Loading branch information
klihub committed Jun 6, 2024
commit 8f56974eb755a4a09d1013a82f30d9593fc50b9a
14 changes: 7 additions & 7 deletions pkg/adaptation/adaptation_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ var _ = Describe("Adaptation", func() {
When("SyncFn is nil", func() {
var (
syncFn func(ctx context.Context, cb nri.SyncCB) error
updateFn = func(ctx context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) {
updateFn = func(_ context.Context, _ []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) {
return nil, nil
}
)
Expand All @@ -119,7 +119,7 @@ var _ = Describe("Adaptation", func() {
When("UpdateFn is nil", func() {
var (
updateFn func(ctx context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error)
syncFn = func(ctx context.Context, cb nri.SyncCB) error {
syncFn = func(_ context.Context, _ nri.SyncCB) error {
return nil
}
)
Expand Down Expand Up @@ -385,7 +385,7 @@ var _ = Describe("Pod and container requests and events", func() {
}

order []*mockPlugin
recordOrder = func(p *mockPlugin, pod *api.PodSandbox, ctr *api.Container) error {
recordOrder = func(p *mockPlugin, _ *api.PodSandbox, _ *api.Container) error {
order = append(order, p)
return nil
}
Expand Down Expand Up @@ -435,7 +435,7 @@ var _ = Describe("Plugin container creation adjustments", func() {
s = &Suite{}
)

adjust := func(subject string, p *mockPlugin, pod *api.PodSandbox, ctr *api.Container, overwrite bool) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) {
adjust := func(subject string, p *mockPlugin, _ *api.PodSandbox, _ *api.Container, overwrite bool) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) {
plugin := p.idx + "-" + p.name
a := &api.ContainerAdjustment{}
switch subject {
Expand Down Expand Up @@ -845,7 +845,7 @@ var _ = Describe("Plugin container updates during creation", func() {
s = &Suite{}
)

update := func(subject, which string, p *mockPlugin, pod *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) {
update := func(subject, which string, p *mockPlugin, _ *api.PodSandbox, ctr *api.Container) (*api.ContainerAdjustment, []*api.ContainerUpdate, error) {
plugin := p.idx + "-" + p.name

if which != plugin && which != "*" && which != "both" {
Expand Down Expand Up @@ -1216,7 +1216,7 @@ var _ = Describe("Solicited container updates by plugins", func() {
s = &Suite{}
)

update := func(subject, which string, p *mockPlugin, pod *api.PodSandbox, ctr *api.Container, r, exp *api.LinuxResources) ([]*api.ContainerUpdate, error) {
update := func(subject, which string, p *mockPlugin, _ *api.PodSandbox, ctr *api.Container, _, _ *api.LinuxResources) ([]*api.ContainerUpdate, error) {
plugin := p.idx + "-" + p.name

if which != plugin && which != "*" && which != "both" {
Expand Down Expand Up @@ -1807,7 +1807,7 @@ var _ = Describe("Unsolicited container update requests", func() {
recordedUpdates []*nri.ContainerUpdate
)

runtime.updateFn = func(ctx context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) {
runtime.updateFn = func(_ context.Context, updates []*nri.ContainerUpdate) ([]*nri.ContainerUpdate, error) {
recordedUpdates = updates
return nil, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/adaptation/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func (r *result) adjust(rpl *ContainerAdjustment, plugin string) error {
if err := r.adjustEnv(rpl.Env, plugin); err != nil {
return err
}
if err := r.adjustHooks(rpl.Hooks, plugin); err != nil {
if err := r.adjustHooks(rpl.Hooks); err != nil {
return err
}
if rpl.Linux != nil {
Expand Down Expand Up @@ -458,7 +458,7 @@ func splitEnvVar(s string) (string, string) {
return split[0], split[1]
}

func (r *result) adjustHooks(hooks *Hooks, plugin string) error {
func (r *result) adjustHooks(hooks *Hooks) error {
if hooks == nil {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/adaptation/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ func (m *mockPlugin) onClose() {
}
}

func (m *mockPlugin) Configure(_ context.Context, cfg, runtime, version string) (stub.EventMask, error) {
func (m *mockPlugin) Configure(_ context.Context, _, _, _ string) (stub.EventMask, error) {
m.q.Add(PluginConfigured)

return m.mask, nil
Expand Down Expand Up @@ -690,7 +690,7 @@ func (q *EventQ) Add(e *Event) {
}
}

func (q *EventQ) Reset(e *Event) {
func (q *EventQ) Reset() {
q.Lock()
defer q.Unlock()
q.q = []*Event{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
)

// FromOCILinuxResources returns resources from an OCI runtime Spec.
func FromOCILinuxResources(o *rspec.LinuxResources, ann map[string]string) *LinuxResources {
func FromOCILinuxResources(o *rspec.LinuxResources, _ map[string]string) *LinuxResources {
if o == nil {
return nil
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/net/multiplex/mux.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,16 +429,16 @@ func (c *conn) RemoteAddr() net.Addr {
}

// SetDeadline is the unimplemented stub for the corresponding net.Conn function.
func (c *conn) SetDeadline(t time.Time) error {
func (c *conn) SetDeadline(_ time.Time) error {
return nil
}

// SetReadDeadline is the unimplemented stub for the corresponding net.Conn function.
func (c *conn) SetReadDeadline(t time.Time) error {
func (c *conn) SetReadDeadline(_ time.Time) error {
return nil
}

// SetWriteDeadline is the unimplemented stub for the corresponding net.Conn function.
func (c *conn) SetWriteDeadline(t time.Time) error {
func (c *conn) SetWriteDeadline(_ time.Time) error {
return nil
}
29 changes: 0 additions & 29 deletions pkg/net/net_suite_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/stub/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ func (stub *stub) Synchronize(ctx context.Context, req *api.SynchronizeRequest)
}

// Shutdown the plugin.
func (stub *stub) Shutdown(ctx context.Context, req *api.ShutdownRequest) (*api.ShutdownResponse, error) {
func (stub *stub) Shutdown(ctx context.Context, _ *api.ShutdownRequest) (*api.ShutdownResponse, error) {
handler := stub.handlers.Shutdown
if handler != nil {
handler(ctx)
Expand Down