Skip to content

Commit

Permalink
[release/1.6] adjust some nolint comments
Browse files Browse the repository at this point in the history
Some changes to account for 91800c4
and 894af07

    runtime/v2/shim/shim.go:178:18: directive `//nolint:staticcheck // Ignore SA4023 as some platforms always return error` is unused for linter "staticcheck" (nolintlint)
        if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
                        ^
    runtime/v2/shim/shim.go:264:18: directive `//nolint:staticcheck // Ignore SA4023 as some platforms always return error` is unused for linter "staticcheck" (nolintlint)
        if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
                        ^
    runtime/v2/shim/shim.go:269:39: directive `//nolint:staticcheck // Ignore SA4023 as some platforms always return error` is unused for linter "staticcheck" (nolintlint)
            if err := subreaper(); err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
                                                ^
    runtime/v2/shim/shim.go:448:67: directive `//nolint:staticcheck // Ignore SA4023 as some platforms always return error` is unused for linter "staticcheck" (nolintlint)
        if err := serve(ctx, server, signals, sd.Shutdown); err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
                                                                         ^
    runtime/v2/shim/shim.go:480:18: directive `//nolint:staticcheck // Ignore SA4023 as some platforms always return error` is unused for linter "staticcheck" (nolintlint)
        if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
                        ^
    integration/main_test.go:446:31: directive `//nolint:unused` is unused for linter "unused" (nolintlint)
    func KillPid(pid int) error { //nolint:unused

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Mar 7, 2023
1 parent 95655f4 commit 77160e6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion integration/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ func KillProcess(name string, signal syscall.Signal) error {
}

// KillPid kills the process by pid. kill is used.
func KillPid(pid int) error { //nolint:unused
func KillPid(pid int) error {
output, err := exec.Command("kill", strconv.Itoa(pid)).CombinedOutput()
if err != nil {
return fmt.Errorf("failed to kill %d - error: %v, output: %q", pid, err, output)
Expand Down
16 changes: 8 additions & 8 deletions runtime/v2/shim/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func setLogger(ctx context.Context, id string) (context.Context, error) {
l.Logger.SetLevel(logrus.DebugLevel)
}
f, err := openLog(ctx, id)
if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
if err != nil { //nolint:nolintlint,staticcheck // Ignore SA4023 as some platforms always return error
return ctx, err
}
l.Logger.SetOutput(f)
Expand Down Expand Up @@ -261,12 +261,12 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi
setRuntime()

signals, err := setupSignals(config)
if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
if err != nil { //nolint:nolintlint,staticcheck // Ignore SA4023 as some platforms always return error
return err
}

if !config.NoSubreaper {
if err := subreaper(); err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
if err := subreaper(); err != nil { //nolint:nolintlint,staticcheck // Ignore SA4023 as some platforms always return error
return err
}
}
Expand Down Expand Up @@ -395,14 +395,14 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi
initContext.TTRPCAddress = ttrpcAddress

// load the plugin specific configuration if it is provided
//TODO: Read configuration passed into shim, or from state directory?
//if p.Config != nil {
// TODO: Read configuration passed into shim, or from state directory?
// if p.Config != nil {
// pc, err := config.Decode(p)
// if err != nil {
// return nil, err
// }
// initContext.Config = pc
//}
// }

result := p.Init(initContext)
if err := initialized.Add(result); err != nil {
Expand Down Expand Up @@ -445,7 +445,7 @@ func run(ctx context.Context, manager Manager, initFunc Init, name string, confi
}
}

if err := serve(ctx, server, signals, sd.Shutdown); err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
if err := serve(ctx, server, signals, sd.Shutdown); err != nil { //nolint:nolintlint,staticcheck // Ignore SA4023 as some platforms always return error
if err != shutdown.ErrShutdown {
return err
}
Expand Down Expand Up @@ -477,7 +477,7 @@ func serve(ctx context.Context, server *ttrpc.Server, signals chan os.Signal, sh
}

l, err := serveListener(socketFlag)
if err != nil { //nolint:staticcheck // Ignore SA4023 as some platforms always return error
if err != nil { //nolint:nolintlint,staticcheck // Ignore SA4023 as some platforms always return error
return err
}
go func() {
Expand Down

0 comments on commit 77160e6

Please sign in to comment.