Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You could write your own syntax sugar functions with signatures like...

    func copyArrStringShallow(x []string) []string { return x }
    // strings are immutable in go, but for []byte etc also deep copy that.
    func copyArrStringDeep(x []string) []string {
      ret := make([]string, 0, len(x))
      copy(ret, x)
      return ret
    }


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: