move lang.Must into logx.Must to make sure output fatal message as json

This commit is contained in:
kevin
2020-08-14 15:08:06 +08:00
parent 9d9399ad10
commit 8745039877
21 changed files with 69 additions and 70 deletions

View File

@@ -3,7 +3,7 @@ package sysx
import (
"os"
"github.com/tal-tech/go-zero/core/lang"
"github.com/tal-tech/go-zero/core/stringx"
)
var hostname string
@@ -11,7 +11,9 @@ var hostname string
func init() {
var err error
hostname, err = os.Hostname()
lang.Must(err)
if err != nil {
hostname = stringx.RandId()
}
}
func Hostname() string {