golang
已收录文章:13974篇
-
限流器是提升服务稳定性的非常重要的组件,可以用来限制请求速率,保护服务,以免服务过载。限流器的实现方法有很多种,常见的限流算法有固定窗口、滑动窗口、漏桶、令牌桶 简单来说439 收藏
-
命令: go build -ldflags "-H windowsgui" 编译文件.go 例如: go build -ldflags "-H windowsgui" main.go 常用参数: -o "chen.exe" 增加此参数则编译后的输出文件名称改为chen.exe 补充:golang 常用快捷键,编译linu439 收藏
-
我就废话不多说了,大家还是直接看代码吧~ type Wait interface { // Register waits returns a chan that waits on the given ID. // The chan will be triggered when Trigger is called with // the same ID. Register(id uint64) <-chan int439 收藏
-
baliance/gooxml gooxml是可以对整个office document提供支持的golang库,功能很强大,这里简单给出对word文档的读取案例 安装 go get baliance.com/gooxml/ go build -i baliance.com/gooxml/… 解析word代码 package main imp439 收藏
-
go build 报错: main.go:5:2: cannot find package “gopkg.in/go-playground/validator.v9” in any of: /usr/local/go/src/gopkg.in/go-playground/validator.v9 (from $GOROOT) /root/work/testjdcloud/src/gopkg.in/go-playground/validator.v9 (from $GOPATH)439 收藏
-
‘…' 其实是go的一种语法糖。 它的第一个用法主要是用于函数有多个不定参数的情况,可以接受多个不确定数量的参数。 第二个用法是slice可以被打散进行传递。 下面直接上例子: func test1439 收藏