Skip to content

Commit 6204eb2

Browse files
authored
Merge pull request #154 from Peefy/fix-kcl-go-lib-home
fix: kcl go lib home
2 parents 182418f + b84b1e1 commit 6204eb2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

go/native/loader.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,7 @@ import (
1212
const libName = "kclvm_cli_cdylib"
1313

1414
func libPath() (path string, err error) {
15-
libHome := os.Getenv("KCL_LIB_HOME")
16-
if libHome == "" {
17-
return lazypath.DataHome(), nil
18-
}
19-
return libHome, nil
15+
return lazypath.DataHome(), nil
2016
}
2117

2218
func fullLibName() string {
@@ -32,6 +28,10 @@ func fullLibName() string {
3228
func loadServiceNativeLib() (uintptr, error) {
3329
libPath, err := libPath()
3430
libPath = filepath.Join(libPath, "kcl")
31+
envLibHome := os.Getenv("KCL_LIB_HOME")
32+
if envLibHome != "" {
33+
libPath = envLibHome
34+
}
3535
if err != nil {
3636
return 0, err
3737
}

0 commit comments

Comments
 (0)