erning/gorun

Does `gorun` work with local package import?

pengyu opened this issue · 0 comments

The following example shows that gorun does not work with local package import. Can this problem be fixed?

$ cat main.go
#!/usr/bin/env gorun
// vim: set noexpandtab tabstop=2:

package main

import (
  "fmt"
  "./mypackage"
)

func main() {
 fmt.Println(mypackage.Add(1, 2))
}

$ cat mypackage/myfile.go
// vim: set noexpandtab tabstop=2:

package mypackage

import "fmt"

func Add(x, y int) int {
  return x + y
}
$ ./main.go 
/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/gorun-alhena.local-504/darwin_amd64/%Users%pengy%linux%test%golang%bin%gorun%norun%main.go.gorun.99864.go:8:3: cannot find package "./mypackage" in:
	/var/folders/r7/bvmh1vvx41d63snvgbdz7bl40000gr/T/gorun-alhena.local-504/darwin_amd64/mypackage
error: failed to run go: exit status 1