cmd/gogio: restore package path handling

A previous change converted the package argument to gogio to an absolute path.
However, gogio supports all package paths that may appear in Go import statements.
For example, the path "gioui.org/cmd/example/kitchen" should not be converted.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-11-26 11:17:40 +01:00
parent 39787cb5b7
commit 9b54892cc4
2 changed files with 7 additions and 16 deletions
+1 -4
View File
@@ -46,7 +46,7 @@ func main() {
fmt.Fprintf(os.Stderr, "gogio: %v\n", err)
os.Exit(1)
}
buildInfo, err := newBuildInfo(getPkgAbsPath())
buildInfo, err := newBuildInfo(flag.Arg(0))
if err != nil {
fmt.Fprintf(os.Stderr, "gogio: %v\n", err)
os.Exit(1)
@@ -63,9 +63,6 @@ func flagValidate() error {
if pkgPathArg == "" {
return errors.New("specify a package")
}
if _, err := filepath.Abs(pkgPathArg); err != nil {
return err
}
if *target == "" {
return errors.New("please specify -target")
}