29 of 59 directives did nothing. Removing each one individually and re-running the gate revealed no issue from any of them: 20 named gosec, which is not enabled in .golangci.yml and never has been, plus 4 nilerr in functions that return no error, 2 dupl where dupl reports nothing repo-wide, and one each of contextcheck, nestif and unused. The funlen name on settings.go:147 is gone for the same reason; its gocyclo and cyclop names are both live. The unused directive in webui/authorize.go sat on `var _ = slog.Default`, a statement that only existed to keep the log/slog import alive. Both go. The 30 remaining directives all suppress a real issue.
21 lines
527 B
Go
21 lines
527 B
Go
//go:build !linux
|
|
|
|
package extension
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
// confinedCommand refuses: extensions run only where their egress can be
|
|
// confined to the hosts the operator accepted.
|
|
func confinedCommand(context.Context, *os.File, string) (*exec.Cmd, error) {
|
|
return nil, errors.New("extensions need Linux network namespaces to confine their egress")
|
|
}
|
|
|
|
func openCommand(ctx context.Context, binary *os.File) *exec.Cmd {
|
|
return exec.CommandContext(ctx, binary.Name()) // the host-verified binary
|
|
}
|