-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge
Milestone
Description
go1.3.1 FieldsFunc runs over the runes twice. If a closure is used, and the underlying state does't match the first run, there may be a panic. The following panics (http://play.golang.org/p/P1MKh8GKaF) state := false f := func(c rune) bool { switch c { case '1': fmt.Println(state) state = !state return state default: fmt.Println("true") return true } } strings.FieldsFunc(" 1", f) This should be safe from panics, or at least clearly document that FieldsFunc is run twice.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DocumentationIssues describing a change to documentation.Issues describing a change to documentation.FrozenDueToAge