I know gc assures this, but I don't know if it is compiler specified or a 
spec rule.

It looks that the function "Index(s, sep string) int" in strings package 
has not a fromIndex parameter.
So I must use strings.Index(s[fromIndex:], sep) to search a substr from a 
specified index.
This implies the cost of the operation s[fromIndex:] would be small.

But I can't Go spec make the guarantee that a substring shares the 
underlying bytes with the original string.
Or I missed it?

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to