1. if a function's signature is f `func([]byte)` and we have a string s, then when we call `f([]byte(s))` golang wont create a []byte then copy, in opposite, golang will use the internal byte slice in string. 2. if we use a for range to set every item in slice to a const value, then the for range will be auto turn to memset.
i want to know where i can find all these language optimize, so avoid to do useless human opt again. -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e1b17d4e-9767-40bd-a77b-5b970d53c2a3n%40googlegroups.com.