mirror of
https://github.com/bootdotdev/fcc-learn-golang-assets.git
synced 2025-12-14 09:11:16 +00:00
first
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"question": "What does 'go install' do?",
|
||||
"answers": [
|
||||
"Compiles and installs the program locally",
|
||||
"Installs dependencies",
|
||||
"Saves local code to the remote source control provider"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# Go Install
|
||||
|
||||
## Build an executable
|
||||
|
||||
Ensure you are in your `hellogo` repo, then run:
|
||||
|
||||
```bash
|
||||
go install
|
||||
```
|
||||
|
||||
Navigate out of your project directory:
|
||||
|
||||
```bash
|
||||
cd ../
|
||||
```
|
||||
|
||||
Go has installed the `hellogo` program globally. Run it with:
|
||||
|
||||
```bash
|
||||
hellogo
|
||||
```
|
||||
|
||||
## Tip about "not found"
|
||||
|
||||
If you get an error regarding "hellogo not found" it means you probably don't have your Go environment setup properly. Specifically, `go install` is adding your binary to your `GOBIN` directory, but that may not be in your `PATH`.
|
||||
|
||||
You can read more about that here in the [go install docs](https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies).
|
||||
Reference in New Issue
Block a user