随笔分类 -  Gin

Gin是用Go(Golang)编写的Web框架。他是一个类似于martini但拥有更好性能的API框架,由于httprouter,速度提高了40倍。
golang 解决Gin框架,body参数只能读取一次问题
摘要:在使用gin框架的时候,发现请求的body数据只允许读取一次。 读取第二次BindJSON这一步报错:EOF。 利用golang官方库,推荐这种方法解决这个问题 package main import ( "fmt" "gopkg.in/gin-gonic/gin.v1" "net/http" "i 阅读全文

posted @ 2022-01-21 15:47 星河赵 阅读(902) 评论(0) 推荐(0) 编辑

Go 指针相关操作
摘要:Go指针相关操作 输出结果456 //null_interface.go package main import "fmt" type Image2 struct { name string } func (I *Image2) SetName() { I.name = "123" } func m 阅读全文

posted @ 2022-01-06 18:45 星河赵 阅读(38) 评论(0) 推荐(0) 编辑

Supervisor 部署go gin服务 或在Linux下面独立部署
摘要:一、Supervisor 部署方式 1. supervisord 安装 wget https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg sh setuptools-0.6c11-py2.7.egg 阅读全文

posted @ 2021-12-30 16:47 星河赵 阅读(377) 评论(0) 推荐(0) 编辑

go gin框架解析json
摘要:Gin框架踩坑——[GIN-debug] [WARNING] Headers were already written. Wanted to override status code 400 with 200 这个报错场景为 : 1.Gin框架、2.编写POST请求方式接口、3.使用结构体绑定方式接 阅读全文

posted @ 2021-12-28 11:21 星河赵 阅读(1113) 评论(0) 推荐(0) 编辑

golang go 中字符串和各种int类型之间的相互转换方式
摘要:go 字符串和int互转 1.string转成int: int, err := strconv.Atoi(string) 2.string转成int64: int64, err := strconv.ParseInt(string, 10, 64) 3.int转成string: string := 阅读全文

posted @ 2021-12-17 14:26 星河赵 阅读(1640) 评论(0) 推荐(0) 编辑

Gin 项目运行基本步骤
摘要:1.编译并调试 go build &&./ginEssential 2.运行命令 go run main.go routes.go 阅读全文

posted @ 2020-10-22 11:22 星河赵 阅读(1346) 评论(0) 推荐(0) 编辑

Gin 框架mysql的连接搭建
摘要:Gin框架中mysql的连接 安装驱动 go get github.com/go-sql-driver/mysql 安装Gorm go get -u github.com/jinzhu/gorm package main import ( "fmt" "github.com/gin-gonic/gi 阅读全文

posted @ 2020-10-21 18:58 星河赵 阅读(3831) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示