随笔分类 -  Go

摘要:解决方法: 在生成protocol文件后,执行如下命令,去除omitempty标签即可。 Get-ChildItem -Path "C:\path\to\directory" -Recurse -Filter "*.pb.go" | ForEach-Object { $file = $_.FullN 阅读全文
posted @ 2023-02-27 09:43 JohnRey 阅读(547) 评论(0) 推荐(0) 编辑
摘要:func removeParentheses(strInfo string) string { strReg := "\\(.*?\\)|\\{.*?}|\\[.*?]|(.*?)" reg := regexp.MustCompile(strReg) return reg.ReplaceAllStr 阅读全文
posted @ 2022-08-19 09:40 JohnRey 阅读(393) 评论(0) 推荐(0) 编辑
摘要:错误类型如下 go: github.com/360EntSecGroup-Skylar/excelize@v1.3.1-0.20180527032555-9e463b461434: Get "https://proxy.golang.org/github.com/360%21ent% 21sec%2 阅读全文
posted @ 2022-07-07 10:02 JohnRey 阅读(248) 评论(0) 推荐(1) 编辑
摘要:Mac 下编译 Linux 和 Windows 64位可执行程序 CGO_ENABLED=0 Mac 下编译 Linux 和 Windows 64位可执行程序 CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build main.go CGO_ENABLED=0 G 阅读全文
posted @ 2017-11-27 22:25 JohnRey 阅读(930) 评论(0) 推荐(0) 编辑
摘要:Python 2.7版本内置此条命令:python –m SimpleHTTPServer 8080在终端输入此命令,一个HTTP服务器就起来了,8080端口是可选的,为空则默认为80端口,此操作会将当前所在的文件夹设置为默认的web目录。在我日常工作中,会经常用到此命令进行pc端与移动端文件的传输 阅读全文
posted @ 2017-09-18 16:45 JohnRey 阅读(699) 评论(0) 推荐(0) 编辑
摘要:package main import( "fmt" ) const( B float64 = 1 <<(iota * 10) KB MB GB TB PB EB ZB YB ) func main() { fmt.Println(B) fmt.Println(KB) fmt.Print... 阅读全文
posted @ 2016-09-08 16:51 JohnRey 阅读(305) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示