This commit is contained in:
wagslane
2023-05-01 15:25:27 -06:00
parent f8912668b8
commit 9be3074de6
868 changed files with 58698 additions and 2 deletions

View File

@@ -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"
]
}

View File

@@ -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).