Golang start and tips

19
Golang getting started & give up JAJA

Transcript of Golang start and tips

Page 1: Golang start and tips

Golang getting started & give up

JAJA

Page 2: Golang start and tips

Outline• Use gvm manage your golang version• Folder structure• Use glide manage your package• Vscode on golang• Use makefile

Page 3: Golang start and tips

Use gvm manage your golang version• Easy to install any golang version• Easy to change golang version • Easy to change golang environment• Simple

Page 4: Golang start and tips

Use gvm manage your golang version

https://github.com/moovweb/gvm

Page 5: Golang start and tips

Use gvm manage your golang version

Page 6: Golang start and tips

Use gvm manage your golang version

Page 7: Golang start and tips

Folder structure

https://golang.org/doc/code.html#GOPATH

Page 8: Golang start and tips

Folder structure

https://github.com/Masterminds/glide

Page 9: Golang start and tips

Folder structure by YEOMAN

Default is for one main application

Page 10: Golang start and tips

Folder structure by YEOMAN

Easy install & run testing

Page 11: Golang start and tips

Folder structure by YEOMAN

Mutileple main application

Page 12: Golang start and tips

Use glide manage your package

https://glide.readthedocs.io/en/latest/versions/

Page 13: Golang start and tips

Use glide manage your packagehttps://glide.readthedocs.io/en/latest/glide.yaml/

Remove dependency detect ( add excludeDirs on glide.yaml)

https://glide.readthedocs.io/en/latest/glide.yaml/

Page 14: Golang start and tips

Use glide manage your package

Page 15: Golang start and tips

Vscode on golang

Page 16: Golang start and tips

Vscode on golang

Page 17: Golang start and tips

Why your folder structure is important gocode

godef

Refactoring…

Page 18: Golang start and tips

Use makefile

Page 19: Golang start and tips

Thank you