Just some notes for working with slices in Go. Mostly JavaScript array equivalent functions. // unshift: add to index 0 func unshift(slice []interface{}, val interface{}) []interface{} { return append([]interface{}{val}, slice...) } // shift: remove from index 0 func shift(slice []interface{}) []interface{} { return slice[1: