True, feel free to rewrite the entire example!
On 21 Nov 2013 08:40, "NanXiao" <notifications@github.com> wrote:

> In ex-basics/src/string3.go:
>
> > +
> > +import (
> > +	"fmt"
> > +	"unicode/utf8"
> > +)
> > +
> > +const minStrLen = 7
> > +
> > +func main() {
> > +	s := "Шла Саша по шоссе"
> > +	r := []rune(s)
> > +	if utf8.RuneCount([]byte(s)) < minStrLen {
> > +		fmt.Printf("The length of string is shorter than %d\n", minStrLen)
> > +		return
> > +	}
> > +	copy(r[4:4+3], []rune("abc"))
>
> Personally, I think it is a not good programming habit to use hardcode
> (copy(r[4:4+3], []rune("abc"))), and it seems OK just as an example.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/miekg/gobook/pull/48/files#r7818169>
> .
>