From b84b1e1a56f761c94ac21270d894d026eb445b1b Mon Sep 17 00:00:00 2001 From: Peefy Date: Mon, 21 Oct 2024 18:45:38 +0800 Subject: [PATCH] fix: kcl go lib home Signed-off-by: Peefy --- go/native/loader.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/go/native/loader.go b/go/native/loader.go index d803a7b..01fbdc4 100644 --- a/go/native/loader.go +++ b/go/native/loader.go @@ -12,11 +12,7 @@ import ( const libName = "kclvm_cli_cdylib" func libPath() (path string, err error) { - libHome := os.Getenv("KCL_LIB_HOME") - if libHome == "" { - return lazypath.DataHome(), nil - } - return libHome, nil + return lazypath.DataHome(), nil } func fullLibName() string { @@ -32,6 +28,10 @@ func fullLibName() string { func loadServiceNativeLib() (uintptr, error) { libPath, err := libPath() libPath = filepath.Join(libPath, "kcl") + envLibHome := os.Getenv("KCL_LIB_HOME") + if envLibHome != "" { + libPath = envLibHome + } if err != nil { return 0, err }