Skip to content

Commit

Permalink
command.go cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
qjerome committed Jul 25, 2022
1 parent 28e1e43 commit 1ebccc2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions api/command.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package api

import (
"context"
"encoding/json"
"errors"
"fmt"
Expand Down Expand Up @@ -46,7 +45,6 @@ type Command struct {
SentTime time.Time `json:"sent-time"`

runnable bool
path []string
}

// NewCommand creates a new Command to run on an endpoint
Expand Down Expand Up @@ -120,16 +118,6 @@ func (c *Command) FromExecCmd(cmd *exec.Cmd) {
}
}

// BuildCmd builds up an exec.Cmd from Command
func (c *Command) BuildCmd() (*exec.Cmd, error) {
if c.Timeout > 0 {
// we create a command with a timeout context if needed
ctx, _ := context.WithTimeout(context.Background(), c.Timeout)
return exec.CommandContext(ctx, c.Name, c.Args...), nil
}
return exec.Command(c.Name, c.Args...), nil
}

func (c *Command) Unrunnable() {
c.runnable = false
}
Expand Down

0 comments on commit 1ebccc2

Please sign in to comment.