Skip to content

Go

Groups/Orgs/Conferences

Learn

Guide

Books

Lists

Language Comparisons

Blogs

Inspiration

Repos to Learn

Youtube

Rob Pike

Ideas to Explore

Concepts

Bits

Channels

Contexts

Structures

Pointers

Interfaces

Concurrency

Error Handling

  • Function Failure Reporting: Error or OK
  • "If the function is guaranteed to complete successfully, and this is either by having no way to fail, or by handling failures in it, there is no reason to return either an error or an OK bool."
  • "error is an interface, which has a performance penalty over a bool variable. This performance penalty can be considered minor, depending on the function purpose. This might be a good reason to prefer an OK bool return type."
  • Working with Errors in Go 1.13 (The Go Blog)
  • Errors are values
  • REST API Error Handling in Go: Behavioral Type Assertion
  • Error handling guidelines for Go
  • Don’t just check errors, handle them gracefully (Dave Cheney)
  • "By far the worst problem with sentinel error values is they create a source code dependency between two packages. As an example, to check if an error is equal to io.EOF, your code must import the io package."
  • "While error types are better than sentinel error values, because they can capture more context about what went wrong, error types share many of the problems of error values. So again my advice is to avoid error types, or at least, avoid making them part of your public API."
  • "Assert errors for behaviour, not type"
  • "Don’t just check errors, handle them gracefully"
  • "Only handle errors once"
    func Write(w io.Writer, buf []byte) error {
            _, err := w.Write(buf)
            if err != nil {
                    // annotated error goes to log file
                    log.Println("unable to write:", err)

                    // unannotated error returned to caller
                    return err
            }
            return nil
    }

    // vs

    func Write(w io.Write, buf []byte) error {
            _, err := w.Write(buf)
            return errors.Wrap(err, "write failed")
    }

Generics

Projects, Documentation & Testing

Packages & Modules

Documentation

Testing

Style & Best Practices

Web

Servers & Sockets

Libraries

Reading

Websockets

HTTP Requests

API Clients

Redis

Web Assembly

Misc

Geospatial

Tools

People/Groups

Geometry

Databases/Trees

CLI

  • jblindsay/go-spatial: GoSpatial is a simple command-line interface program for manipulating geospatial data
  • tschaub/gpq: A utility for working with GeoParquet

Geocoding

Formats

OSM

  • paulmach/osm: General purpose library for reading, writing and working with OpenStreetMap data
  • maguro/pbf: OpenStreetMap PBF golang parser
  • qedus/osmpbf: OpenStreetMap PBF file format parser in Go Lang.
  • flopp/go-staticmaps: A go (golang) library and command line tool to render static map images using OpenStreetMap tiles
  • glaslos/go-osm: osm file parser in golang
  • thomersch/gosmparse: Processing OpenStreetMap PBF files at speed with Go
  • tidwall/osmfile: A downloader and reader for the OSM planet files.
  • pelias/pbf2json: An OpenStreetMap pbf parser which exports json, allows you to cherry-pick tags and handles denormalizing ways and relations. Available as a standalone binary and comes with a convenient npm wrapper.
  • qedus/osmpbf: OpenStreetMap PBF file format parser in Go Lang.
  • omniscale/imposm3: Imposm imports OpenStreetMap data into PostGIS
  • codesoap/osmar: A simple command line tool to explore osm data

Other Libraries

Examples

Data Formats

JSON

Apache Arrow

Graphics

Images

Color

Draw

  • tdewolff/canvas: Cairo in Go: vector to SVG, PDF, EPS, raster, HTML Canvas, etc.
  • fogleman/gg: Go Graphics - 2D rendering in Go with a simple API.

IO

Protocol Buffers & gRPC

Libraries

Containers

Numerical Computing

Science & Simulation

Machine Learning

CLI's & GUI's

Libraries

TUIs

Spinners & Progress Bars

Examples

Learn

Databases

Postgres

SQLite

Filesystems & Storage

  • seaweedfs/seaweedfs: SeaweedFS is a fast distributed storage system for blobs, objects, files, and data lake, for billions of files! Blob store has O(1) disk seek, cloud tiering. Filer supports Cloud Drive, cross-DC active-active replication, Kubernetes, POSIX FUSE mount, S3 API, S3 Gateway, Hadoop, WebDAV, encryption, Erasure Coding.
  • ipfs/kubo: IPFS implementation in Go
  • Blob
  • gokrazy/rsync?: gokrazy rsync

Noise

Performance & Size

Profiling & Benchmarking

Optimization

Allocation & Memory

Garbage Collection

Projects

Security

Hugo

Themes

Theme: Congo

Games

Misc

Libraries

Reading

Watching

Mascot

Applications

  • Wails v2: Build beautiful cross-platform applications using Go

Logging

Orbitals & Ephemerides