I don't known why I can not get the path value. may be there something error or other, path = os.Getenv("GOMOD") // path is ""
1.project go env:
....
GOMOD="/home/lu/go/gowork/work/gt/go.mod"
...
- system go env:
...
GOMOD=""
...
I solve it: in golang code,
import "github.com/dreamlu/gt/tool/file/file_func"
path = file_func.ProjectPath()
print the path = "/home/lu/go/gowork/work/gt/go.mod"