mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 08:23:41 +00:00
main: use GOPATH from the environment
Be more compatible with the Go toolchain by setting GOPATH in the same way. This makes it possible to flash and run examples from the standard GOPATH instead of only from the source tree.
This commit is contained in:
@@ -22,6 +22,7 @@ func Compile(pkgName, outpath string, spec *TargetSpec, printIR, dumpSSA, debug
|
||||
Debug: debug,
|
||||
DumpSSA: dumpSSA,
|
||||
RootDir: sourceDir(),
|
||||
GOPATH: getGopath(),
|
||||
BuildTags: spec.BuildTags,
|
||||
}
|
||||
c, err := compiler.NewCompiler(pkgName, config)
|
||||
@@ -198,6 +199,7 @@ func Flash(pkgName, target, port string, printIR, dumpSSA, debug bool, printSize
|
||||
func Run(pkgName string) error {
|
||||
config := compiler.Config{
|
||||
RootDir: sourceDir(),
|
||||
GOPATH: getGopath(),
|
||||
}
|
||||
c, err := compiler.NewCompiler(pkgName, config)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user