Golang

Updated . Posted . Visible to the public.

Parse JSON request

dec := json.NewDecoder(req.Body)
var target Target
if err := dec.Decode(&target); err != nil {
  return err
}

Slicing

len(a[0:x]) # => x

Godep

Update all third-party packages this package depends on (DOES NOT include test dependencies)

go get github.com/dolzenko/deplist

go list -f '{{.ImportPath}}' ./... | xargs -n 1 deplist | grep -v P | sort -u | xargs go get -u -v
Ev Dolzhenko
Last edit
Ev Dolzhenko
Posted by Ev Dolzhenko to Ev's deck (2014-05-14 15:18)