Initial commit

This commit is contained in:
Christopher Crone
2020-05-28 13:29:02 +02:00
commit bff6023b1a
12 changed files with 275 additions and 0 deletions

24
main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"fmt"
"os"
"strings"
"github.com/pkg/errors"
)
func echo(args []string) error {
if len(args) < 2 {
return errors.New("no message to echo")
}
_, err := fmt.Println(strings.Join(args[1:], " "))
return err
}
func main() {
if err := echo(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "%+v\n", err)
os.Exit(1)
}
}