Re: [go-nuts] strings and when to use them

2017-05-11 Thread Ilya Kostarev
On Wed, 10 May 2017 10:05:56 -0700 (PDT) Zachary Kaplan wrote: > can somebody please explain to me when a function > should to return a string as opposed to, say a []byte? thanks > Just a few examples. Strings can be keys in map[string]something, []byte can't be a key due to them are non compara

[go-nuts] strings and when to use them

2017-05-10 Thread Zachary Kaplan
in golang, strings are immutable. thus, if i want to modify a string in place, i'll need to cast or copy each element from the string to a similar but mutable data structure. this seems inefficient for simple command line programs that take input from stdin and access it through os.Args. can so