Slices: Occurs this issue in Ocean? #18

Closed
opened 2014-06-09 07:00:09 +00:00 by thorsten · 3 comments
thorsten commented 2014-06-09 07:00:09 +00:00 (Migrated from devops.tsommer.org)
https://groups.google.com/forum/#!topic/golang-nuts/tMyrfMHbXkk (Question) http://play.golang.org/p/kxC0Ca0WW2 (bad) http://play.golang.org/p/7rwPe4tvTu (good) http://blog.golang.org/go-slices-usage-and-internals (Theory)
thorsten commented 2014-06-12 08:31:40 +00:00 (Migrated from devops.tsommer.org)

The rule is: If you use the append() function, create first a copy!

**The rule is:** If you use the append() function, create first a copy!
thorsten commented 2014-06-12 10:31:30 +00:00 (Migrated from devops.tsommer.org)

Maybe I should implement a function within the Tools package to do this:

newBytes := make([]byte, len(bytes))
copy(newBytes, bytes)
newBytes = append(newBytes, char)
Maybe I should implement a function within the Tools package to do this: ``` newBytes := make([]byte, len(bytes)) copy(newBytes, bytes) newBytes = append(newBytes, char) ```
thorsten commented 2022-04-23 15:34:02 +00:00 (Migrated from devops.tsommer.org)

changed the description

changed the description
thorsten (Migrated from devops.tsommer.org) closed this issue 2022-04-23 15:34:02 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Go/Ocean#18
No description provided.