parameter 'ctx' seems to be unused, consider removing or renaming it as _
108 return nil, cExec.ErrRunExecNotSupported
109}
110
111func (n *ovs) AddLinkToContainer(ctx context.Context, link netlink.Link, f func(ns.NetNS) error) error {112 // retrieve the namespace handle
113 ns, err := ns.GetCurrentNS()
114 if err != nil {
parameter 'ctx' seems to be unused, consider removing or renaming it as _
128 return nil, cExec.ErrRunExecNotSupported
129}
130
131func (b *bridge) AddLinkToContainer(ctx context.Context, link netlink.Link, f func(ns.NetNS) error) error {132 // retrieve the namespace handle
133 ns, err := ns.GetCurrentNS()
134 if err != nil {
Description
Unused parameters in functions or methods should be replaced with _
(underscore) or removed.
Functions or methods with unused parameters can be a symptom of unfinished
refactoring or a bug. If an unused parameter is present, it should be named _
(underscore) to avoid raising this issue and better readability.
Bad practice
func abc(unused string) {
fmt.Println("Not using any passed params.")
}
Recommended
func abc(_ string) {
fmt.Println("Not using any passed params.")
}
func abc() {
fmt.Println("Not using any passed params.")
}