mirror of
https://github.com/alvierahman90/gohookr.git
synced 2024-11-22 08:09:52 +00:00
Implement Stringer in Command type
This commit is contained in:
parent
87ea4cc5e5
commit
cf65488907
@ -1,6 +1,9 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import "os/exec"
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os/exec"
|
||||||
|
)
|
||||||
|
|
||||||
type Command struct {
|
type Command struct {
|
||||||
Program string
|
Program string
|
||||||
@ -17,3 +20,11 @@ func (c Command) Execute(payload string) ([]byte, error) {
|
|||||||
|
|
||||||
return exec.Command(c.Program, arguments...).Output()
|
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