go-lang-plugin-org / go-lang-idea-plugin

Google Go language IDE built using the IntelliJ Platform
https://plugins.jetbrains.com/plugin/5047
Other
4.56k stars 571 forks source link

How To compile with multi file #2511

Closed linyilong33 closed 8 years ago

linyilong33 commented 8 years ago

how to compile multi-file liks this: go build -o mygo.exe main.go export.go

I compile "Go Application --- File", it support single file and I try to compile "Go Application-package",but it tips cannot find package 'xxxx'

dlsniper commented 8 years ago

Closing as accidentally opened issue. Please edit it and reopen or open a new one. Thank you.

dlsniper commented 8 years ago

If you use Go Application, which you should, your package needs to be present in GOPATH and you must type the full package path (e. g. github.com/user/package).

linyilong33 commented 8 years ago

@dlsniper i add my project to GOPATH,and edit config,select Run Kind->Package and input package "mygo" or full package path(E:\study\mygo), but it tips cannot find package "xxx"

dlsniper commented 8 years ago

The plugin respects the Go workspace layout: https://golang.org/doc/code.html#Workspaces If you add your package under GOPATH/src/xxx then it you'll be to use it with xxx not e:\some\directory\path\src\xxx If your package is under GOPATH/src/github.com/user/xxx then you must use github.com/user/xxx The plugin will print the GOPATH used in the compilation, please provide a screenshot with the output of that window. If the go tool will complain that something is missing from the GOPATH then most likely there's a misconfiguration either in the plugin or the package is not present in the GOPATH.