[go-nuts] Best way to truncate a ridiculously long string in GO

2017-08-21 Thread Tamás Gulácsi
prefix := string([]byte(verylongstring[:3])) -- 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 htt

[go-nuts] Best way to truncate a ridiculously long string in GO

2017-08-21 Thread Travis Keep
Suppose you have code like this // verylongstring may be several thousand bytes long verylongstring := GetSomeVeryLongString() prefix := verylongstring[:3] prefixStore.StorePrefixForDurationOfApplication(prefix) If I understand correctly, verylongstring cannot be garbage colle