要安装Gin包,首先需要安装Go并设置Go工作区
1、下载并安装
$ go get -u github.com/gin-gonic/gin
2、在代码中导入它
import "github.com/gin-gonic/gin"
使用包管理工具Govendor安装
1、go get govendor(安装)
$ go get github.com/kardianos/govendor
2、创建项目文件夹并进入文件夹
$ mkdir -p $GOPATH/src/github.com/myusername/project && cd "$_"
3、初始化项目并添加 gin
$ govendor init
$ govendor fetch github.com/gin-gonic/gin@v1.3
4、复制一个模板到你的项目
$ curl https://raw.githubusercontent.com/gin-gonic/gin/master/examples/basic/main.go > main.go
5、运行项目
$ go run main.go
注意
使用gin需要Go的版本号为1.6或更高
gin框架安装
原创
©著作权归作者所有:来自51CTO博客作者盼盼编程的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Logback - 日志框架
日志管理之Logback...
日志管理 Java -
gin框架01--快速入门gin框架
@TOC介绍Gin 是一个用 Go (Gol
golang 中间件 快速入门gin框架 golang web框架 json -
Web 框架 Gin | Gin快速入门
大家好!我是 xcbeyond, xcbeyond 就是我,大家也可以叫我超哥!本文首发于我的博客:Gin 介绍1、Gin 概述Gin 是一个
go Gin github HTTP JSON