My binaries end up in the src folder and I have no idea why. I want them to end up in gopath/bin (since that is the default? and since I don't want binaries on git). The packages end up in gopath/pkg with their binaries in their respective folder. I don't even know if this folder structure is considered good.
Gopath is set to the gopath
folder on the D:\
drive, and gobin
is not set.
It should be in $GOPATH/src/yourpath - using symlinks here is very useful.
go build builds the command and leaves the result in the current working directory. go install builds the command in a temporary directory then moves it to $GOPATH/bin .
The GOPATH environment variable It defaults to a directory named go inside your home directory, so $HOME/go on Unix, $home/go on Plan 9, and %USERPROFILE%\go (usually C:\Users\YourName\go ) on Windows. If you would like to work in a different location, you will need to set GOPATH to the path to that directory.
Add the Go install directory to your system's shell path. That way, you'll be able to run your program's executable without specifying where the executable is. Once you've updated the shell path, run the go install command to compile and install the package. Run your application by simply typing its name.
If you can pass a command line parameter to LiteIDE's go build
instruction, you can do something like this;
go build -o $GOPATH/bin/outputfile.exe source.go
As you can see in the liteIDE FAQ:
<action id="BuildAndRun" img="blue/buildrun.png" key="Ctrl+R;Ctrl+F7" task="Build;Run"/> <action id="Install" menu="Build" img="blue/install.png" key="Ctrl+F8" cmd="$(GO)" args="install $(INSTALLARGS)" save="all" output="true"/>
go build
.go install
Only the latter would build your exe in GOPATH/bin
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With