mirror of
https://github.com/alvierahman90/gohookr.git
synced 2024-12-22 08:11:58 +00:00
Implement Stringer in Command type
This commit is contained in:
parent
87ea4cc5e5
commit
cf65488907
@ -1,6 +1,9 @@
|
||||
package config
|
||||
|
||||
import "os/exec"
|
||||
import (
|
||||
"fmt"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
type Command struct {
|
||||
Program string
|
||||
@ -17,3 +20,11 @@ func (c Command) Execute(payload string) ([]byte, error) {
|
||||
|
||||
return exec.Command(c.Program, arguments...).Output()
|
||||
}
|
||||
|
||||
func (c Command) String() string {
|
||||
return fmt.Sprintf(
|
||||
"<Command cmd=%v AppendPayload=%v>",
|
||||
append([]string{c.Program}, c.Arguments...),
|
||||
c.AppendPayload,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user