initial import
This commit is contained in:
19
core/sysx/host.go
Normal file
19
core/sysx/host.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package sysx
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"zero/core/lang"
|
||||
)
|
||||
|
||||
var hostname string
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
hostname, err = os.Hostname()
|
||||
lang.Must(err)
|
||||
}
|
||||
|
||||
func Hostname() string {
|
||||
return hostname
|
||||
}
|
||||
Reference in New Issue
Block a user