From 7b87dcf0f65ee3596173706ecff52f49b3a80cce Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 25 Mar 2023 17:23:22 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/model/conf.go | 2 +- kernel/util/os.go | 6 +++--- kernel/util/os_mobile.go | 2 +- kernel/util/runtime.go | 8 ++------ 4 files changed, 7 insertions(+), 11 deletions(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index 6b9557d5f..f62182955 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -248,7 +248,7 @@ func InitConf() { logging.LogInfof("using Microsoft Store edition") } Conf.System.OS = runtime.GOOS - Conf.System.OSPlatform, _ = util.GetOSPlatform() + Conf.System.OSPlatform = util.GetOSPlatform() if "" != Conf.UserData { Conf.User = loadUserFromConf() diff --git a/kernel/util/os.go b/kernel/util/os.go index 77063519a..0677fc8b8 100644 --- a/kernel/util/os.go +++ b/kernel/util/os.go @@ -23,11 +23,11 @@ import ( "github.com/siyuan-note/logging" ) -func GetOSPlatform() (plat, ver string) { - plat, _, ver, err := host.PlatformInformation() +func GetOSPlatform() (plat string) { + plat, _, _, err := host.PlatformInformation() if nil != err { logging.LogWarnf("get os platform failed: %s", err) - return "Unknown", "" + return "Unknown" } return } diff --git a/kernel/util/os_mobile.go b/kernel/util/os_mobile.go index 439b8f69a..efc139e65 100644 --- a/kernel/util/os_mobile.go +++ b/kernel/util/os_mobile.go @@ -18,7 +18,7 @@ package util -func GetOSPlatform() (plat, ver string) { +func GetOSPlatform() (plat string) { if ContainerIOS == Container { return "iOS " + MobileOSVer } diff --git a/kernel/util/runtime.go b/kernel/util/runtime.go index 055d2cc1f..ccd5a0f4d 100644 --- a/kernel/util/runtime.go +++ b/kernel/util/runtime.go @@ -46,11 +46,7 @@ var IsExiting = false var MobileOSVer string func logBootInfo() { - plat, platVer := GetOSPlatform() - osInfo := plat - if "" != platVer { - osInfo += " " + platVer - } + plat := GetOSPlatform() logging.LogInfof("kernel is booting:\n"+ " * ver [%s]\n"+ " * arch [%s]\n"+ @@ -62,7 +58,7 @@ func logBootInfo() { " * container [%s]\n"+ " * database [ver=%s]\n"+ " * workspace directory [%s]", - Ver, runtime.GOARCH, osInfo, os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir) + Ver, runtime.GOARCH, plat, os.Getpid(), Mode, WorkingDir, ReadOnly, Container, DatabaseVer, WorkspaceDir) } func IsMutexLocked(m *sync.Mutex) bool {