On Tue, Jan 16, 2018 at 9:05 AM, <pengyu...@gmail.com> wrote: > > I don't fine the help page of `range`. Does anybody if there is a way to > find it with `go doc`? > > $ go doc range > doc: /Users/xxx/linux/test/golang/lang/import/strings/Split/main.go:1:1: > illegal character U+0023 '#' > exit status 1
`go doc` is useful for finding function documentation, but it doesn't help for language constructs like `range`. The use of `range` as part of a `for` statement is documented in the language spec at https://golang.org/ref/spec#For_statements and is discussed in Effective Go at https://golang.org/doc/effective_go.html#for . Ian -- 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.