Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 操作系统平台版本信息

Liang Ding81f0d5f33e40
diff --git a/kernel/model/conf.go b/kernel/model/conf.go
index 6b9557d5f3..f62182955e 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 77063519aa..0677fc8b8d 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 439b8f69a4..efc139e656 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 055d2cc1f0..ccd5a0f4d1 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 {