Go
天下皆白_唯我独黑
爱我所爱,恨我所恨,墨眉无锋,似剑非攻。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
GO 微信支付V3SDK回调踩坑
通过微信官网提示安装sdk外部库下面只讲解微信支付回调部分先成功下一单微信支付拿到支付回调的数据,方便后续调试因为在go里面打印请求参数不方便我使用的php打印全部参数, 圈起来的部分是我们需要用到的数据。原创 2023-06-27 14:38:00 · 3119 阅读 · 0 评论 -
Go mac打包生成为linux可运行二进制包
直接在mac上编译打包后放到linux上运行直接报错 cannot execute binary file。经过查询需要指定环境打包,但是打包的命令要注意一下格式输入。原创 2023-03-29 11:50:58 · 3581 阅读 · 0 评论 -
Goland 打开项目不识别导入包,但是可以正常编译解决
1、2、正确配置goroot3、gopath添加自己的项目目录点击应用转载 2021-07-13 16:10:11 · 6301 阅读 · 2 评论 -
Go 字符串驼峰与蛇形互转
/** * 驼峰转蛇形 snake string * @description XxYy to xx_yy , XxYY to xx_y_y * @date 2020/7/30 * @param s 需要转换的字符串 * @return string **/func snakeString(s string) string { data := make([]byte, 0, len(s)*2) j := false num := len(s) for i := 0; i < n.转载 2020-07-30 14:31:50 · 7465 阅读 · 0 评论 -
go mod 常用命令笔记
go Modules 的使用配置Environment地址:https://goproxy.cn,direct命令 注释 go mod init 初始化项目,在当前项目下跟main.go go mod tidy 找到项目的第三方依赖 ...原创 2020-07-27 16:10:45 · 233 阅读 · 0 评论 -
Go time 时间的各种格式转换
比如2020-07-15T16:00:00.000Z 转成2020-07-15 16:00:00strTime := "2020-07-15T16:00:00.000Z" t1,_ :=time.Parse(time.RFC3339,strTime) fmt.Println(t1) t3 := t1.Unix() fmt.Println(t3) t2 := t1.Format("2006-01-02 15:04:05") fmt.Println(t2)time.Parse 可以解.原创 2020-07-24 13:37:51 · 3027 阅读 · 0 评论 -
GoLand ide编辑器设置方法注释模板
mac GoLand 2020.1版:一、找到:Preferences | Editor |Code Templates| (首选项,编辑器,代码模板)二、点击加号选择live template三、创建一个快捷键名如(/att)这样在代码中输入/att会自动生成模板,添加描述,添加注释模板/*** @author $user$* @description //TODO $end$* @date $time$ $date$* @param $param$...原创 2020-07-22 17:47:48 · 3797 阅读 · 3 评论 -
GoLand ide编辑器设置代码配色
注释配色:原创 2020-07-22 17:08:15 · 1205 阅读 · 0 评论 -
go 把一个数据列表上下级菜单组装成二维数组
原始数据:pid代表父级id 0代表顶级,现在要把二级分类归类到顶级分类中作为一个二维数组返回var ( topMenuArr = make([]map[string]interface{}, 0) //顶级菜单切片数组-列表 secondaryMenuArr = make(map[uint32][]interface{}, 0) //二级菜单切片数组-列表 resList = make(map[string]interface{}, 0) //上原创 2020-07-21 13:48:27 · 495 阅读 · 0 评论 -
go 语言常用方法
整形转string:/**整形转字符串*/func IntToString(reply interface{}) (string, error) { var str string switch reply := reply.(type) { //on break case int: intData := int64(reply) str = strconv.FormatInt(intData, 10) case int8: intData := int64(reply)原创 2020-07-17 16:01:25 · 279 阅读 · 0 评论 -
goland编辑器 相关配置
go Modules 配置Environmenthttps://goproxy.cn,direct原创 2020-06-03 12:01:16 · 474 阅读 · 0 评论
分享