go

How do I convert date to the string in go using locale?

折月煮酒 提交于 2021-01-22 13:22:06
问题 I convert date to a string this way: d.Format("Mon 02. Jan") and I get something like Fri 27. Jan How can I switch the locale and get the string in other language? 回答1: You can't. The Go standard library does not contain localized month, day and zone names. The names are wired into the time package. For example, the name of the months returned by Month.String() are stored in the unexported time.month global variable: var months = [...]string{ "January", "February", "March", "April", "May",

How do I convert date to the string in go using locale?

眉间皱痕 提交于 2021-01-22 13:21:31
问题 I convert date to a string this way: d.Format("Mon 02. Jan") and I get something like Fri 27. Jan How can I switch the locale and get the string in other language? 回答1: You can't. The Go standard library does not contain localized month, day and zone names. The names are wired into the time package. For example, the name of the months returned by Month.String() are stored in the unexported time.month global variable: var months = [...]string{ "January", "February", "March", "April", "May",

开源魔兽世界私服搭建

生来就可爱ヽ(ⅴ<●) 提交于 2021-01-22 12:34:35
本文档具有可操作性,不是网络上互相抄袭的博客。 觉得有用就赞一个,项目源码: https://github.com/geektcp/alpha-wow.git 一、背景 60魔兽经典旧世是最经典的版本,遗憾的是60年代时还在大学读书,穷得很,买不起点卡,后来工作了,大概70年代开始玩的。 多年以前,玩游戏时,一直非常期望能够自己控制角色的属性级别,得到各种装备。 多年以后,在这款纯粹的开源服务器问世后,终于如愿以偿。 直到如今,都2020年,魔兽世界游戏的服务端源码项目在开源界依然非常活跃。 让我们重温经典吧。 二、demo 客户端下载 wow-1.12.3版本 ,只需要修改一处配置文件realmlist.wtf SET realmlist wow.whyalive.org 指向上面的服务器地址即可。 测试帐号: test1/123 wow/123 如果你懒得DIY自行编译安装,可以用上面给的demo账号和环境,下载客户端,修改配置文件,就可以登录游戏了。 三、客户端 魔兽世界经典旧世客户端1.12.3下载地址: https://pan.baidu.com/s/1BgIYpZEmfTiAmeD_lMB1Sg 四、服务器端 下面的编译安装过程比较多,但我已经尽可能完整的整理出来。基本上没有疏漏。 1、编译服务端有版本要求 env version os CentOS 6.5 elf

cannot find runtime/cgo in Alpine

安稳与你 提交于 2021-01-22 08:34:43
问题 In an alpine:edge container I installed go via RUN apk add --no-cache musl-dev go I try to run go get github.com/golang/protobuf/protoc-gen-go then. This results in the error message: go: finding github.com/golang/protobuf/protoc-gen-go latest go: finding github.com/golang/protobuf v1.3.1 go: downloading github.com/golang/protobuf v1.3.1 go: extracting github.com/golang/protobuf v1.3.1 # github.com/golang/protobuf/protoc-gen-go loadinternal: cannot find runtime/cgo protoc-gen-go: program not

Go: reference types as arguments

心已入冬 提交于 2021-01-22 06:31:15
问题 Certain types in Go are reference types: maps, slices, channels, functions, and methods. Sometimes you need to use pointers to references. For example, type Stack []interface{} func (stack *Stack) Push(x interface{}) { *stack = append(*stack, x) } You need it because all arguments are passed by copying the value, and append() might need to reallocate memory in the slice's capacity is not big enough. I get that. First question. How about map types? If I have a custom type based on a map ,

Go: reference types as arguments

*爱你&永不变心* 提交于 2021-01-22 06:29:08
问题 Certain types in Go are reference types: maps, slices, channels, functions, and methods. Sometimes you need to use pointers to references. For example, type Stack []interface{} func (stack *Stack) Push(x interface{}) { *stack = append(*stack, x) } You need it because all arguments are passed by copying the value, and append() might need to reallocate memory in the slice's capacity is not big enough. I get that. First question. How about map types? If I have a custom type based on a map ,

(Zap log framework, Go) Initialize log once and reuse from other Go file (Solved)

纵饮孤独 提交于 2021-01-22 03:16:13
问题 I'm trying to migrate my application from the beautiful Logrus (very helpful for debug) and introducing the Uber log framework Zap. With Logrus, i can initialize the logger only once and reuse it from other Go file, an example: package main import( // Print filename on log filename "github.com/onrik/logrus/filename" // Very nice log library log "github.com/sirupsen/logrus" ) func main(){ // ==== SET LOGGING Formatter := new(log.TextFormatter) Formatter.TimestampFormat = "Jan _2 15:04:05

(Zap log framework, Go) Initialize log once and reuse from other Go file (Solved)

那年仲夏 提交于 2021-01-22 03:16:09
问题 I'm trying to migrate my application from the beautiful Logrus (very helpful for debug) and introducing the Uber log framework Zap. With Logrus, i can initialize the logger only once and reuse it from other Go file, an example: package main import( // Print filename on log filename "github.com/onrik/logrus/filename" // Very nice log library log "github.com/sirupsen/logrus" ) func main(){ // ==== SET LOGGING Formatter := new(log.TextFormatter) Formatter.TimestampFormat = "Jan _2 15:04:05

golang go语言通道类型的通道示例 通道的通道

不羁的心 提交于 2021-01-22 02:48:41
几点注意:go的 无缓存通道 通道make 创建后,即使里面是空的,也可以取里面内容。但是程序会被阻塞。 通道的规则是没人取,是不能往里面放的。放的线程会阻塞。 最外层的requestChan相当于一个总线或媒介。 生产者goroutineD直接从requestChan通道里面再取一个内部通道responseChan,这时不管responseChan创建没有,如果没有的话会阻塞,直到取到后,往responseChan通道里面扔内容。 消费者goroutineC创建一个内部通道responseChan,然后就可以提取里面的内容。如果没有阻塞直到收到。 收取开始后,requestChan中介通道里面就没有responseChan内部通道了? package main import " fmt " import " time " func main() { // make the request chan chan that both go-routines will be given requestChan := make(chan chan string ) // start the goroutines go goroutineC(requestChan) go goroutineD(requestChan) // sleep for a second to let the

远控免杀专题(11)-Avoidz免杀(VT免杀率23/71)

大憨熊 提交于 2021-01-21 23:59:32
声明:文中所涉及的技术、思路和工具仅供以安全为目的的学习交流使用,任何人不得将其用于非法用途以及盈利等目的,否则后果自行承担! 本专题文章导航 1、远控免杀专题(1)-基础篇: https://mp.weixin.qq.com/s/3LZ_cj2gDC1bQATxqBfweg 2、远控免杀专题(2)-msfvenom隐藏的参数: https://mp.weixin.qq.com/s/1r0iakLpnLrjCrOp2gT10w 3、远控免杀专题(3)-msf自带免杀(VT免杀率35/69): https://mp.weixin.qq.com/s/A0CZslLhCLOK_HgkHGcpEA 4、远控免杀专题(4)-Evasion模块(VT免杀率12/71): https://mp.weixin.qq.com/s/YnnCM7W20xScv52k_ubxYQ 5、远控免杀专题(5)-Veil免杀(VT免杀率23/71): https://mp.weixin.qq.com/s/-PHVIAQVyU8QIpHwcpN4yw 6、远控免杀专题(6)-Venom免杀(VT免杀率11/71): https://mp.weixin.qq.com/s/CbfxupSWEPB86tBZsmxNCQ 7、远控免杀专题(7)-Shellter免杀(VT免杀率7/69): https://mp