• 2024-04-24go学习00
    下载gin失败解决办法:cmd输入goenv-wGO111MODULE=ongoenv-wGOPROXY=https://goproxy.io,direct即可安装gin包gogetgithub.com/gin-gonic/gingoland中go.mod的require是灰色解决办法:即可愉快运行Demopackagemainimport( "github.com/gin-gonic/gin")func
  • 2024-01-31在gin-gonic框架下,gin.context 输出json, 默认会将&转义为\u0026, 怎么将这个转义关闭呢?
    在gin-gonic中,如果你想要禁止对&等字符进行转义,可以使用gin.Context的PureJSON方法。这个方法允许你自己控制JSON输出,而不会进行字符的转义。以下是一个简单的例子:packagemainimport( "github.com/gin-gonic/gin" "net/http")funcmain(){ router:=gin.Default()
  • 2024-01-23GoLang 安装设置代理
    在下载Gin时goinstallgithub.com/gin-gonic/gin@latest 提示如下:go:github.com/gin-gonic/gin@latest:modulegithub.com/gin-gonic/gin:Get"https://proxy.golang.org/github.com/gin-gonic/gin/@v/list":dialtcpxxx.xxx.xxx.xxx:xxx:connectex:Aconnecti
  • 2023-06-27Gin快速入门
    参考https://gin-gonic.com/zh-cn/docs/quickstart/安装goget-ugithub.com/gin-gonic/gin引入代码import"github.com/gin-gonic/gin"gomod管理一个新项目#创建新项目mkdirawesomeProjectcdawesomeProject#初始化gomodinit#拉取缺少的模块,移除不用的模块
  • 2023-05-05go 快速入门
    1.下载并安装gin:$goget-ugithub.com/gin-gonic/gin使用Gomodules工具管理项目初始化gomod$gomodinitlearninggopackagemainimport"github.com/gin-gonic/gin"funcmain(){r:=gin.Default()r.GET("/ping",func(c*gin.Context
  • 2023-04-09gin框架介绍及安装
    前言:Gin是一个用Go(Golang)编写的web框架。封装比较优雅,API友好,源码注释比较明确,具有快速灵活,容错方便等特点,它是一个类似于martini但拥有更好性能的API框架,由于httprouter,速度提高了近40倍。借助框架开发,不仅可以省去很多常用的封装带来的时间,也有助于团队的编
  • 2023-02-16gin-快速入门
    转载自:https://gin-gonic.com/zh-cn/docs/quickstart/要求Go1.13及以上版本安装要安装Gin软件包,需要先安装Go并设置Go工作区。1.下载并安装gin:1$go
  • 2023-02-03Gin框架
    Gin框架学习gin文档github:https://github.com/gin-gonic/gin官网文档:https://gin-gonic.com/zh-cn/docs/quickstart/中文文档:https://learnku.com/docs/gin-gonic/1.7
  • 2022-12-05go bin安装
    首先进入gopath的安装路径,在\go\src\github.com运行Git终端输入gitclonehttps://github.com/gin-gonic/gin.gitgin-gonic/gin 如果报错,执行gitconfighttp.sslVerify
  • 2022-11-12Gin框架执行:go get -u github.com/gin-gonic/gin 报错
    Gin框架执行:goget-ugithub.com/gin-gonic/gin报错错误信息://无法导入gin包:go:modulegithub.com/gin-gonic/gin:Get"https://proxy.golang.org/github.com/gin-
  • 2022-09-30Gin框架
    安装下载安装gingoget-ugithub.com/gin-gonic/gin将gin库导入到代码中(如果需要使用http.StatusOk之类的常量还需要引入net/http包)import"github.com/gi