Skip to content

Commit

Permalink
Merge pull request #154 from Peefy/fix-kcl-go-lib-home
Browse files Browse the repository at this point in the history
fix: kcl go lib home
  • Loading branch information
Peefy authored Oct 21, 2024
2 parents 182418f + b84b1e1 commit 6204eb2
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 6204eb2

Please sign in to comment.