摘要:
This syntax imports the encoding/base64 package with the b64 name instead of the default 64. It'll save us some space belowpackage mainimport ( b64... 阅读全文
摘要:
SHA1 hashes are frequently used to compute short identities for binary or text blobs. For example, the git revision control system uses SHA1 extensive... 阅读全文
摘要:
Parsing numbers from strings is a basic but common task in many programs; here's how to do it in Gopackage mainimport ( "fmt" "strconv")func mai... 阅读全文
摘要:
A common requirement in programs is getting the number of seconds, millisecond, or nanoseconds since Unix epoch. Here's how to do it in Gopackage main... 阅读全文
摘要:
Go's offers extensive support for times and durations; here are some examplepackage mainimport ( "fmt" "time")func main() { p := fmt.Println ... 阅读全文
摘要:
Go offer built-in support for JSON encoding and decoding, including to and from built-in and custom data typespackage mainimport ( "encoding/json" ... 阅读全文
摘要:
Go ofer built-in support for regular expressions. Here are some examples of common regexp-related tasks in Go.package mainimport ( // "bytes" "f... 阅读全文