Skip to content

Instantly share code, notes, and snippets.

@mdouchement
Last active January 25, 2017 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdouchement/31e1c54e40deb38716982ddef42a78a8 to your computer and use it in GitHub Desktop.
Save mdouchement/31e1c54e40deb38716982ddef42a78a8 to your computer and use it in GitHub Desktop.
Useful Golang packages

Static Build

CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' *.go

Objects

  • structs
    • Various utilities to work with Go (Golang) structs.
    • map[string]interface{} struct conversion.
    • github.com/fatih/structs

JSON

  • gojsonschema
    • An implementation of JSON Schema, based on IETF's draft v4.
    • github.com/xeipuuv/gojsonschema
  • jsonpath
    • A partial implementation of JSON Path. Useful for dig in a JSON data.
    • github.com/yalp/jsonpath

Utils

  • osext
    • Allow binary to find its location at runtime
    • github.com/kardianos/osext
  • compress
    • Compression utilities
    • github.com/klauspost/compress
  • bytebufferpool
    • A pool of byte buffers with anti-memory-waste protection.
    • github.com/valyala/bytebufferpool
  • env
    • A KISS way to deal with environment variables.
    • github.com/caarlos0/env
  • logrus
    • Structured, pluggable logging.
    • github.com/Sirupsen/logrus
  • heredoc
    • Provides the here-document with keeping indent.
    • github.com/MakeNowJust/heredoc
  • cli
    • A simple, fast, and fun package for building command line apps.
    • github.com/urfave/cli

Tools

  • glide
    • Packages/dependencies manager.
    • github.com/Masterminds/glide

API/webserver/background

  • echo
    • Fast and unfancy HTTP server framework.
    • github.com/labstack/echo
  • gorm
  • goose
    • Database migration tool.
    • github.com/pressly/goose
  • machinery
    • Asynchronous task queue/job queue based on distributed message passing.
    • github.com/RichardKnop/machinery
  • govalidator
    • Data validation. Usefull for validating params struct of a REST API.
    • github.com/asaskevich/govalidator

Testing tools/libraries

  • httpexpect
    • Concise, declarative, and easy to use end-to-end HTTP and REST API testing.
    • github.com/gavv/httpexpect
  • ginkgo
    • RSpec like framework
    • github.com/onsi/ginkgo
    • github.com/onsi/gomega (matchers)

Dedicated libraries

  • dns
    • Granular DNS (both client and server side).
    • github.com/miekg/dns
  • sigar
    • System Information Gatherer And Reporter.
    • github.com/cloudfoundry/gosigar
  • hdfs
    • Native client for HDFS.
    • github.com/colinmarc/hdfs

Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment