mirror of
https://github.com/FiloSottile/mkcert.git
synced 2025-10-14 00:41:40 +08:00
Swap exec.Command("hostname") for os.Hostname() (#137)
This commit is contained in:

committed by
Filippo Valsorda

parent
9e9563535e
commit
c03e3ceaca
5
cert.go
5
cert.go
@@ -20,7 +20,6 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
|
||||||
"os/user"
|
"os/user"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
@@ -38,8 +37,8 @@ func init() {
|
|||||||
if u != nil {
|
if u != nil {
|
||||||
userAndHostname = u.Username + "@"
|
userAndHostname = u.Username + "@"
|
||||||
}
|
}
|
||||||
out, _ := exec.Command("hostname").Output()
|
hostname, _ := os.Hostname()
|
||||||
userAndHostname += strings.TrimSpace(string(out))
|
userAndHostname += hostname
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *mkcert) makeCert(hosts []string) {
|
func (m *mkcert) makeCert(hosts []string) {
|
||||||
|
Reference in New Issue
Block a user