上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 69 下一页
摘要: 作者:Latm Ake链接:https://www.zhihu.com/question/20523036/answer/35225920来源:知乎著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 问题 由于zip格式中并没有指定编码格式,Windows下生成的zip文件中的编码 阅读全文
posted @ 2020-02-11 19:50 jihite 阅读(4872) 评论(1) 推荐(2) 编辑
摘要: 功能 自动生产接口文档 安装 # 安装swaggo get -u github.com/swaggo/swag/cmd/swag # 安装 gin-swagger go get -u github.com/swaggo/gin-swagger go get -u github.com/swaggo/ 阅读全文
posted @ 2020-02-07 22:37 jihite 阅读(884) 评论(0) 推荐(0) 编辑
摘要: 安装beengo go get github.com/astaxie/beego/validation 直接使用 package main import ( "github.com/astaxie/beego/validation" "log" ) type User struct { Name s 阅读全文
posted @ 2020-02-07 00:36 jihite 阅读(2500) 评论(0) 推荐(0) 编辑
摘要: 代码实现 main.go package main import ( "fmt" "github.com/jihite/go-gin-example/pkg/setting" "github.com/jihite/go-gin-example/routers" "net/http" ) func m 阅读全文
posted @ 2020-02-05 11:56 jihite 阅读(2699) 评论(0) 推荐(0) 编辑
摘要: 初始化 执行go mod init module-name,其中module-name为包名字,执行完后会生成go.mod文件,如下 module module-name go 1.13 拉取依赖 go get *** 如:go get github.com/jinzhu/gorm 更多参数 用 g 阅读全文
posted @ 2020-02-04 21:04 jihite 阅读(3142) 评论(1) 推荐(0) 编辑
摘要: 背景 有些linux服务器处于内网,并且没有公网ip,故要想与外网进行http/https通信只能通过nat或者加proxy的方式。nat服务器有网段的限制,而http/https proxy代理则没有,使用起来也方便。 同时有部分网址不需要走代理 解决 添加环境变量 设置代理 export htt 阅读全文
posted @ 2020-02-03 22:05 jihite 阅读(13255) 评论(0) 推荐(0) 编辑
摘要: 背景 golang没有queue这种类型,不过可以用slice、list模拟 slice当queue 声明队列 var queue []int 入队一个元素: queue = append(queue, 1) 出队一个元素: if len(queue) > 1 { queue = queue[1:] 阅读全文
posted @ 2020-02-03 21:07 jihite 阅读(3166) 评论(0) 推荐(0) 编辑
摘要: UML Model 基本模型定义 type Model struct { ID int `gorm:"primary_key" json:"id"` CreatedOn int `json:"created_on"` ModifiedOn int `json:"modified_on"` Delet 阅读全文
posted @ 2020-02-02 20:34 jihite 阅读(807) 评论(0) 推荐(0) 编辑
摘要: go build 编译文件,输出可执行文件 (参考) go clean 删除编译生成的可执行文件 go run 编译源码,并执行main()函数 go build 编译源码,生成可执行文件,并将可执行文件移动到 \$GOPATH/pkg 或者\$GOPATH/bin go test 读取源码目录下面 阅读全文
posted @ 2020-02-01 17:52 jihite 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Github地址 https://github.com/EDDYCJY/go-gin-example 返回值 字段:code、msg、data 举例 # 失败 { "code": 10001, "msg": "已存在该标签名称", "data": null } #成功 { "code": 200, 阅读全文
posted @ 2020-01-31 23:57 jihite 阅读(1550) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 69 下一页