mirror of
https://github.com/zeromicro/go-zero.git
synced 2025-01-25 02:08:44 +08:00
20 lines
195 B
Go
20 lines
195 B
Go
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
|
|
}
|