feat: super 包新增 Hostname 函数获取主机名

This commit is contained in:
kercylan98 2023-11-10 11:57:43 +08:00
parent 01092fe738
commit 9157c6a309
1 changed files with 9 additions and 1 deletions

View File

@ -1,6 +1,9 @@
package super
import "time"
import (
"os"
"time"
)
var launchTime = time.Now()
@ -8,3 +11,8 @@ var launchTime = time.Now()
func LaunchTime() time.Time {
return launchTime
}
// Hostname 获取主机名
func Hostname() string {
return os.Getenv("HOSTNAME")
}