FAQ
Maybe I don't understand the problem correctly, but if buf_1 does not have enough capacity for data, then the slice returned by append will be different than the one you wanted to append to - although the new slice contains the olds data, too.

Thus you need to push the actual value to buf_1 and buf_2 back to the global vars.

If you do this from different goroutines, then some guard is needed for global var update.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 11 of 12 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 1, '13 at 12:29p
activeNov 3, '13 at 5:22p
posts12
users7
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase