You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
358 B
Go
23 lines
358 B
Go
package builtins
|
|
|
|
import (
|
|
"io"
|
|
"strings"
|
|
)
|
|
|
|
type Echo struct{}
|
|
|
|
func (e *Echo) Name() string {
|
|
return "echo"
|
|
}
|
|
|
|
func (e *Echo) Execute(arguments []string, _ io.Reader, stdout io.Writer, stderr io.Writer) uint8 {
|
|
_, err := stdout.Write([]byte(strings.Join(arguments, " ")))
|
|
if err != nil {
|
|
stderr.Write([]byte(err.Error()))
|
|
return 1
|
|
}
|
|
|
|
return 0
|
|
}
|