This commit is contained in:
sm
2016-09-13 22:02:39 -07:00
commit b52911c21d
3 changed files with 45 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
package main
import (
"fmt"
"os"
)
func main() {
hn, err := os.Hostname()
if err != nil {
fmt.Fprintf(os.Stderr, "couldn't get hostname: %v\n", err)
os.Exit(1)
}
fmt.Println(hn)
}