hn/main.go

16 lines
192 B
Go
Raw Permalink Normal View History

2016-09-13 22:02:39 -07:00
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)
}