Swap exec.Command("hostname") for os.Hostname() (#137)

This commit is contained in:
David Crawshaw
2019-02-15 15:11:46 -05:00
committed by Filippo Valsorda
parent 9e9563535e
commit c03e3ceaca

View File

@@ -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) {