Skip to content

Instantly share code, notes, and snippets.

@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active June 22, 2024 03:04
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

Serialization: best practices

(In this document I pay attention mostly to data storage in scientific applications, not to web protocols.)

Traditional approaches

  • XML:
    • slow to parse
    • schemas (.xsd) are human-readable but hard to edit without special software
  • tooling for generating code for reading/writing is limited (mostly to Java)