From c03e3ceaca0490e2c8f9ae3cdbe3e9fac5f7df37 Mon Sep 17 00:00:00 2001 From: David Crawshaw Date: Fri, 15 Feb 2019 15:11:46 -0500 Subject: [PATCH] Swap exec.Command("hostname") for os.Hostname() (#137) --- cert.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cert.go b/cert.go index b3c8e82..853d831 100644 --- a/cert.go +++ b/cert.go @@ -20,7 +20,6 @@ import ( "math/big" "net" "os" - "os/exec" "os/user" "path/filepath" "regexp" @@ -38,8 +37,8 @@ func init() { if u != nil { userAndHostname = u.Username + "@" } - out, _ := exec.Command("hostname").Output() - userAndHostname += strings.TrimSpace(string(out)) + hostname, _ := os.Hostname() + userAndHostname += hostname } func (m *mkcert) makeCert(hosts []string) {