From b4cb72502003e012bf8d08532e5ec27ddd517d87 Mon Sep 17 00:00:00 2001 From: i4k Date: Sun, 1 Oct 2017 13:12:06 -0300 Subject: [PATCH] add pwd command Signed-off-by: i4k --- stdbin/pwd/main.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 stdbin/pwd/main.go diff --git a/stdbin/pwd/main.go b/stdbin/pwd/main.go new file mode 100644 index 00000000..96b2a369 --- /dev/null +++ b/stdbin/pwd/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "os" +) + +func main() { + wd, err := os.Getwd() + if err != nil { + fmt.Fprintf(os.Stderr, "error: %s", err) + os.Exit(1) + } + fmt.Println(wd) +}