I read a lot about "You can run a Go program from binaries without even having Go installed on your machine", etc. How exactly should I execute the app?
In my case I have a console application which sends emails if a certain event occurs. There also is a .toml file for configuring it. How should I run the app on a PC which does not have Go installed and is running Ubuntu 14.04.1 (Trusty Tahr) 64-bit OS?
The application should be executed just like any other binary can be executed in the given OS. In your case, running on Ubuntu, you must first compile the application for that particular architecture:
env GOOS=linux GOARCH=arm go build
Then you can modify the permissions of the binary to be executable:
chmod +x my-app
And simply execute it:
./my-app
To avoid using ./
or any other path to the binary, you can copy the binary file to your /usr/local/bin/
path.
For example-
app
chmod +x ~/Downloads/app
/usr/local/bin
- cp ~/Downloads/app /usr/local/bin/app
app
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