英文: GoLang: Reading and casting bytes into struct fields 问题 我正在从io.Reader中逐个字段地读取到一个结构体中。 // structF...
无法在vim中自动格式化Go(golang)代码。
英文: Cannot auto format go (golang) code in vim 问题 我遇到了以下命令的问题: autocmd FileType go autocmd BufWriteP...
为什么我的哈希表实现如此慢?
英文: Go: Why is my hashtable implementation so slow? 问题 所以我正在尝试创建一个超轻、故意占用大量内存但非常快速的哈希表,用于非常快速的查找,我不关...
[Golang]使用指针类型、指针类型或结构类型调用方法的区别是什么?
英文: [Golang]Different about call a method with pointer type, using point type or struct type? 问题 标题所...
How to replace a letter at a specific index in a string in Go?
英文: How to replace a letter at a specific index in a string in Go? 问题 我想在字符串的特定索引处替换一个字母:aaaaaaa -&g...
Golang的参数化多态性?
英文: Golang Parametric polymorphism? 问题 我写了一个函数来计算浮点数数组的标准差,但是我遇到了一个问题,如果我有一个整数数组,我该如何使用它呢? func StdD...
这个哈希函数的范围是从0到32位的,它将输入映射到一个32位的哈希值。
英文: Go: How does this hash function range from 0-32 bits? 问题 我正在尝试编写一个使用30位哈希的自定义哈希函数。 下面是一个用于FNVa 3...
What does ^ do?
英文: What does ^ do? 问题 我希望这个问题不会太愚蠢...我不知道在Go语言中^运算符是做什么用的,例如: a := 3^500 起初我以为它可能是幂运算(pow),但它肯定不是。它...
使用反射设置一个字段的指针。
英文: Set a pointer to a field using reflection 问题 我有以下的结构体,并且需要一些字段可以为null,所以我使用了指针,主要是为了处理SQL的null值。...
为什么在goroutine中似乎无法使用睡眠(sleep)函数?
英文: why does it seem that sleep doesn't work in goroutine 问题 package main import ( "fmt"...
364