parameter 'args' seems to be unused, consider removing or renaming it as _
85 Seccomp bool `long:"seccomp" required:"false" description:"Extract the default builtin seccomp filter"`
86}
87
88func (cmd *ExtractInternalConfigCommand) Execute(args []string) error { 89 var dest = cmd.FilePath
90 if cmd.Seccomp {
91 seccompfilter := bespec.GetDefaultSeccompProfile()
parameter 'args' seems to be unused, consider removing or renaming it as _
22 Bits int `short:"b" long:"bits" default:"4096" description:"The number of bits in the key to create."`
23}
24
25func (cmd *GenerateKeyCommand) Execute(args []string) error { 26 key, err := rsa.GenerateKey(rand.Reader, cmd.Bits)
27 if err != nil {
28 return fmt.Errorf("failed to generate key: %s", err)
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.")
}