英文: How to get child's type in golang 问题 我最近一直在学习Go语言。在下面的示例中,我得到了类型a,而不是b。为什么会这样呢?我该如何得到b呢? // ...
在Golang中使用模板创建”加载更多”按钮
英文: Creating load more button in Golang with templates 问题 我想创建一个类似Facebook的页面,在用户向下滚动页面时,无需刷新即可获取旧的帖...
How can we read a json file as json object in golang
英文: How can we read a json file as json object in golang 问题 我有一个存储在本地机器上的JSON文件。我需要将其读入一个变量,并循环遍历以获取...
你可以在Go语言中使用`os.Name()`函数来获取操作系统的名称。
英文: How can I use os.Name() in go? 问题 我正在尝试使用:https://golang.org/src/os/file.go?s=1472:1577#L35 通过导入...
pass ENV VAR to exec.Command?
英文: pass ENV VAR to exec.Command? 问题 我正在为一个流行的命令行工具(ansible-playbook)编写一个Go语言封装,并且我需要通过exec.Command调...
How to fmt.Print("print this on the center")
英文: How to fmt.Print("print this on the center") 问题 可以使用fmt.Println("...")来在终端中实...
Golang中的垃圾通道?
英文: Garbage channel in Golang? 问题 我在我的函数中接受一个done通道,如果调用者关心的话,这对于通知调用者某个异步过程何时完成非常有用。这在编写单元测试时非常有用。 ...
将时间字段编组为Unix时间
英文: Marshalling Time fields as Unix time 问题 我想将我的time.Time字段编码为数字的Unix时间戳,并且我不想为每个结构体实现自定义的MarshalJS...
golang的net模块(LookupSRV)
英文: golang net module(LookupSRV) 问题 我对golang非常陌生,我对Python有一些经验,但不是在这个水平上。我正在创建一个名为"digall"...
有没有内置的方法可以递归打印一棵树?
英文: Is there a built-in way to recursively print a tree? 问题 我正在学习Go,并且正在寻找一种打印AST的方法(参考Ruslan的优秀教程Le...
11727

