/gostudy

Go学习笔记

Primary LanguageGo

Go学习记录

  • basic syntax and data structures: 基本语法和数据结构
  • methods and interfaces: 方法和接口
  • Go's concurrency primitives: Go语言并发基础

开源框架 gin-gonic/gin

Use a Vendor tool like Govendor

  1. go get govendor
    go get github.com/kardianos/govendor
    
  2. Create your project folder and cd inside
    mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
    
  3. Vendor init your project and add gin
    govendor init
    govendor fetch github.com/gin-gonic/gin@v1.3
    
  4. Copy a starting template inside your project
    curl https://raw.githubusercontent.com/gin-gonic/examples/master/basic/main.go > main.go
    
  5. Run your project
    go run main.go