code refactor

This commit is contained in:
Ulric Qin 2022-05-31 18:02:19 +08:00
parent 23873a2be1
commit fec541e565
1 changed files with 2 additions and 2 deletions

View File

@ -41,12 +41,12 @@ func InitHostname() error {
name: hostname,
}
go loopUpdateHostname()
go Hostname.update()
return nil
}
func loopUpdateHostname() {
func (c *HostnameCache) update() {
for {
time.Sleep(time.Second)
name, err := os.Hostname()