Skip to content

Commit

Permalink
fix: kcl go lib home
Browse files Browse the repository at this point in the history
Signed-off-by: Peefy <[email protected]>
  • Loading branch information
Peefy committed Oct 21, 2024
1 parent 182418f commit b84b1e1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions go/native/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
Expand Down

0 comments on commit b84b1e1

Please sign in to comment.