Skip to content

Instantly share code, notes, and snippets.

View paddie's full-sized avatar

Patrick-Ranjit D. Madsen paddie

View GitHub Profile
@paddie
paddie / keybase.md
Last active September 19, 2017 08:52

Keybase proof

I hereby claim:

  • I am paddie on github.
  • I am paddie (https://keybase.io/paddie) on keybase.
  • I have a public key whose fingerprint is 4E33 F113 0B1E 0DFA 9D18 E63C 8DF3 228B 1C4E 4E24

To claim this, I am signing this object:

@paddie
paddie / Append to slice pointer (interface{}) using reflect
Last active September 29, 2015 15:31
I spent quite a bit of time trying to grok how to infer (reflect) the underlying type of a slice, create a new object of that type, and add that to the original slice. So here is the bare bones example of how it is done.
package main
import (
"errors"
"fmt"
"reflect"
)
func RemakeSlice(out interface{}) error {