News for hackers. Stuff that matters.
Re:Go is my hammer, and everything is a nail by mjevans on Monday August 12, 2024 @07:40PM (#41230596)
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
    }

There are no comments on this comment yet.