英文: golang function alias on method receiver 问题 我可以为普通方法创建方法别名: func method1() { fmt.Println("me...
增加 Golang 1.4+ 的最大分配内存。
英文: Increase Max Allocated Memory Golang 1.4+ 问题 我正在考虑升级到Go 1.4,但我担心因为我不再知道如何更改我可以访问的最大内存量。 我一直在使用Go...
从Go程序内部访问包的注释?
英文: Access package comment from inside Go program? 问题 在Go程序中,是否可以从内部获取包的注释?等效的Python代码如下: package ma...
Golang中的嵌套对象在MongoDB中的处理方式
英文: Golang nested objects in MongoDB 问题 我目前正在开发一个小应用程序,允许用户对特定对象进行评分,我的数据库(MongoDB)结构如下: 电影 { Id int...
在golang中是否可以解压tar.xz包?
英文: Is it possible to extract a tar.xz package in golang? 问题 在golang中,是否可以解压tar.xz包?我的理解是可以使用tar库,并将...
如何“动态地”评估外部 Go 源代码?
英文: How to evaluate external go source code "dynamically"? 问题 我需要解析一个Go源代码文件,找到特定的类型(通过名称)...
为什么在解组 JSON 时,字符串和 []bytes 被处理方式不同?
英文: Why are string and []bytes treated differently when unmarshaling JSON? 问题 从阅读文档的理解来看,string本质上是一...
如何解析方法声明?
英文: How to parse a method declaration? 问题 我正在尝试解析一个方法声明。基本上,我需要获取接收器基本类型(type hello)和返回类型(notype和err...
memstats结构中哪些字段仅与堆相关,哪些字段仅与栈相关。
英文: which fields in memstats struct refer only to heap, only to stack 问题 Go运行时有许多与堆和栈相关的不同变量,其中一些栈的数...
在Go语言中使用互斥锁(mutexes)
英文: Using mutexes in Go 问题 我正在尝试理解互斥锁的工作原理。根据我目前的理解,互斥锁用于执行原子操作并同步对某些数据的访问。 我在这里构建了一个队列数据结构的示例:https...
11727

