Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/soartec-lab/golang_setup_doc
This is a document to setup the following golang development environment
https://github.com/soartec-lab/golang_setup_doc
Last synced: about 1 month ago
JSON representation
This is a document to setup the following golang development environment
- Host: GitHub
- URL: https://github.com/soartec-lab/golang_setup_doc
- Owner: soartec-lab
- Created: 2019-04-20T15:27:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-20T15:27:50.000Z (over 5 years ago)
- Last Synced: 2024-10-22T02:14:37.544Z (2 months ago)
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Summary
This is a document to setup the following golang development environment
* Go
* beego
* SublimeText3 packages## Enviroment
### OS version
Ubuntu 18.04.1 LTS### Editor
SublimeText3# Setup
## golang
### InstallSee: https://github.com/golang/go/wiki/Ubuntu
```
$ sudo apt-get update
$ sudo apt-get install golang-go
```### Export environment variable
```.bashrc
$ echo export GOPATH='$HOME/go' >> ~/.bashrc
$ echo export PATH='$PATH:/usr/lib/go-1.10/bin' >> ~/.bashrc
$ echo export PATH='$PATH:$GOPATH/bin' >> ~/.bashrc
$ source ~/.bashrc
```Note: Do not forget reload command
### Install check
```
$ go version
$ go env
```## beego
```
$ go get -u github.com/astaxie/beego
$ go get -u github.com/beego/bee
```## SublimeText3
### tools
```
go get -u -v golang.org/x/tools/cmd/goimports
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/oracle
go get -u -v github.com/golang/lint/golint
```### Sublime Package
Preferences > Package Control: Install Package
Note: short cut is `ctrl + shift + p`
install `Gotools` and `Golang Build`
#### Update Gotools setting
Preferences > Package Settings > GoTools > Settings - Users
```
{
"gopath": "/path/to/go",
"format_backend": "both"
}
```#### Update Golang Build setting
Preferences > Package Settings > Golang Config > Settings - User
```
{
"GOPATH": "/path/to/go",
"PATH:": "/path/to/go/bin"
}
```#### Update key bind
Preferences > Key Bindings - User
```
[
{ "keys": ["super+d"], "command": "gotools_goto_def" },
]
```