add: installation guides

This commit is contained in:
Inanc Gumus
2018-11-17 16:41:36 +03:00
parent 038a61e195
commit d4a81f94e9
7 changed files with 216 additions and 83 deletions

View File

@ -1,84 +1,5 @@
# CHEATSHEET: INSTALLATION
# GO INSTALLATION GUIDES
👉 NOTE: For the missing steps you should continue clicking the Next buttons :)
# 1 Install Visual Studio Code Editor
1. Install it but don't open it yet.
2. Go to: [https://code.visualstudio.com](https://code.visualstudio.com)
3. Select your operating system (OS) and start downloading
1. **Windows**: Run the installer.
2. **OS X**: Uncompress the downloaded file and move it to your `~/Applications` directory.
# 2 Install Git
1. Grab the installer:
1. **Windows:** Go to: [https://gitforwindows.org](https://gitforwindows.org)
2. **OS X & Linux:** Go to: [https://git-scm.com/downloads](https://git-scm.com/downloads)
2. Run the installer
3. Select VSCode as the default editor
1. **Windows**:
1. Enable all the checkboxes
3. Select: _"Use Git from the Windows Command Prompt"_
4. Encodings: Select: _"Checkout as is..." option._
# 3 Install Go
1. Go to [https://golang.org/dl](https://golang.org/dl)
2. Select your OS and download
3. Start the installer
1. **Windows:**
1. Installs Go to `C:\Go`
2. Your `$GOPATH` will be `C:\Go\src`
2. **OS X:**
1. Installs Go to `~/go`
2. Your `$GOPATH` will be `~/go/src`
<div style="page-break-after: always;"></div>
# 4 Configure VS Code
1. Open VS Code; from the extensions tab at the left, search for "go" and install it
2. Close VS Code completely and open it up again
3. Go to View menu; select **Command Palette**
1. Or just press `cmd+shift+p` or `ctrl+shift+p`
2. Type: `go install`
3. Select _"Go: Install/Update Tools"_
4. Check all the checkboxes
4. After it's done, open the **Command Palette** again
1. Type: `shell`
2. Select: _"Install 'code' command in PATH"_
1. **NOTE:** You don't have to do this if you're on Windows.
5. **Additional Step for Windows Users: Git-Bash**
* In this course I'll be using bash commands. Bash is just a command-line interface used in OS X and Linux. It's one of the most popular command-line interfaces. So, if you want to use it too, instead of using the Windows default command-line, you can use git bash that you've installed. With git bash, you can type a command in command-line as you're on OS X or Linux.
* If you don't want to use git bash, it's ok too. It depends on you. But note that, I'll be using bash commands mostly. Because, it allows more advanced commands as well.
* **So, to use git bash, follow these steps:**
1. Just search for git bash from the start bar
2. Or, if there's one, click on the icon on your desktop
3. Also setup VS Code to use git-bash by default:
1. Open VS Code
2. Go to Command Palette
1. Type: `terminal`
2. Select: _"Terminal: Select Default Shell"_
3. And, Select: _"Git Bash"_
4. **NOTE:** Normally, you can find your files under `c:\`, however, when you're using git bash, you'll find them under `/c/` directory. It's actually the very same directory, it's just a shortcut.
## That's all! Enjoy! 🤩
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)
* [OS X](osx-installation.md)
* [Windows](windows-installation.md)
* [Linux (Ubuntu)](ubuntu-installation.md)

View File

@ -0,0 +1,47 @@
# OS X INSTALLATION CHEATSHEET
## 1- Install Visual Studio Code Editor
1. Install it but don't open it yet.
2. Go to: [https://code.visualstudio.com](https://code.visualstudio.com)
3. Select OS X (Mac) and start downloading
4. Uncompress the downloaded file and move it to your `~/Applications` directory.
## 2- Install Git
1. Grab and run the installer. Go to: [https://git-scm.com/downloads](https://git-scm.com/downloads)
2. Select VSCode as the default editor
## 3- Install Go
1. Go to [https://golang.org/dl](https://golang.org/dl)
2. Select OS X (Mac)
3. Start the installer
## 4- Configure VS Code
1. Open VS Code; from the extensions tab at the left, search for "go" and install it
2. Close VS Code completely and open it up again
3. Go to View menu; select **Command Palette**
1. Or just press `cmd+shift+p`
2. Type: `go install`
3. Select _"Go: Install/Update Tools"_
4. Check all the checkboxes
4. After it's done, open the **Command Palette** again
1. Type: `shell`
2. Select: _"Install 'code' command in PATH"_
1. **NOTE:** You don't have to do this if you're on Windows.
## That's all! Enjoy! 🤩
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)

Binary file not shown.

View File

@ -0,0 +1,99 @@
# Linux Installation Cheatsheet
## 1. Update the local packages
```bash
sudo apt-get update
```
## 2. Install git
```bash
sudo apt-get install git
```
## 3. Install Go
Select linux and the download will begin.
```bash
firefox https://golang.org/dl
```
## 4. Copy Go into the proper directory
1. Find out the name of the downloaded file
2. Use that filename to uncompress it
```bash
gofile="DELETE_THIS_AND_TYPE_THE_NAME_OF_THE_DOWNLOADED_FILE_HERE (without its extension)"
tar -C /usr/local -xzf ~/Downloads/$gofile.tar.gz
```
3. Add `go/bin` directory to `$PATH` to be able to run the fundamental Go commands.
```bash
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile
```
4. Add "$HOME/go/bin" directory to $PATH
```bash
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.profile
```
## Install Go Tools:
* These are very handy tools to ease the development (like goimports)
* `go get` cannot be usable without installing a code versioning program like Git which we already have got it above.
* This will create `~/go` directory and will download go tools into there.
* This directory is also a place where you should put your code into.
(If you're not going to use Go Modules)
```bash
go get -v -u golang.org/x/tools/...
```
## Install VSCode
1. Open "Ubuntu Software" application
2. Search for VSCode then click "Install"
3. Install [Vim-Go](https://github.com/fatih/vim-go#install)
## OPTIONAL STEP:
1. Create a hello.go inside `$GOPATH/src`
```bash
cat <<EOF > $GOPATH/src/hello.go
package main
import "fmt"
func main() {
fmt.Println("hello gopher!")
}
EOF
```
2. Go to Go source directory and run our sample program
```bash
cd $GOPATH/src
go run hello.go
It should print: hello gopher!
```
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)

Binary file not shown.

View File

@ -0,0 +1,66 @@
# WINDOWS INSTALLATION CHEATSHEET
## 1- Install Visual Studio Code Editor
1. Install it but don't open it yet.
2. Go to: [https://code.visualstudio.com](https://code.visualstudio.com)
3. Select Windows and start downloading
4. Run the installer
## 2- Install Git
1. Grab and run the installer. Go to: [https://gitforwindows.org](https://gitforwindows.org)
2. Select VSCode as the default editor
3. Enable all the checkboxes
4. Select: _"Use Git from the Windows Command Prompt"_
5. Encodings: Select: _"Checkout as is..." option._
## 3- Install Go
1. Go to [https://golang.org/dl](https://golang.org/dl)
2. Select Windows and download
3. Start the installer
## 4- Configure VS Code
1. Open VS Code; from the extensions tab at the left, search for "go" and install it
2. Close VS Code completely and open it up again
3. Go to View menu; select **Command Palette**
1. Or just press `ctrl+shift+p`
2. Type: `go install`
3. Select _"Go: Install/Update Tools"_
4. Check all the checkboxes
## 5- Using Git-Bash
* In this course I'll be using bash commands. Bash is just a command-line interface used in OS X and Linux. It's one of the most popular command-line interfaces. So, if you want to use it too, instead of using the Windows default command-line, you can use git bash that you've installed. With git bash, you can type a command in command-line as you're on OS X or Linux.
* If you don't want to use git bash, it's ok too. It depends on you. But note that, I'll be using bash commands mostly. Because, it allows more advanced commands as well.
* You can also prefer to use the more powerful alternative to git bash: [Linux Subsystem for Windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
* **So, to use git bash, follow these steps:**
1. Just search for git bash from the start bar
2. Or, if there's one, click on the icon on your desktop
3. Also setup VS Code to use git-bash by default:
1. Open VS Code
2. Go to Command Palette
1. Type: `terminal`
2. Select: _"Terminal: Select Default Shell"_
3. And, Select: _"Git Bash"_
4. **NOTE:** Normally, you can find your files under `c:\`, however, when you're using git bash, you'll find them under `/c/` directory. It's actually the very same directory, it's just a shortcut.
## That's all! Enjoy! 🤩
<div style="page-break-after: always;"></div>
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)
>
> Copyright © 2018 Inanc Gumus
>
> Learn Go Programming Course
>
> [Click here to read the license.](https://creativecommons.org/licenses/by-nc-sa/4.0/)

Binary file not shown.