<p>I split my main.go file into multiple files for organization, but i can't seems to get GoLand to allow me to build it... it errors with something like</p>
<pre><code> .\Main.go:12:5: undefined: functionA
.\Main.go:13:13: undefined: functionB
.\Main.go:13:24: undefined: functionC
</code></pre>
<hr/>**评论:**<br/><br/>dlsniper: <pre><p>Go to Run | Edit Configurations select the run configuration you created and instead of Run Kind file, use Run Kind package. See: <a href="https://youtu.be/ko-wKntCLjg" rel="nofollow">https://youtu.be/ko-wKntCLjg</a> for a visual guide of this. Please note that the linkmode is needed only in special cases, it's entirely optional.</p></pre>SaturnsVoid: <pre><p>thanks! this worked!</p></pre>gngeorgiev: <pre><p>I guess you have the files in the same package, next to main.go. In the go build arguments you need to pass all files of the main package. In the cli it would look like <code>go build *.go</code>. Should be something like this in goland</p></pre>kusrabs: <pre><p>Probably function names in another file should start from capital Letter, not letter.</p></pre>dlsniper: <pre><p>In Go all files in a package (directory) belong to the same package (except for the _test test named packages, in _test.go files). So it doesn't matter how the functions are named.</p></pre>
![](https://static.golangjob.cn/static/img/banner.png)