// copy state so mutations to Until and Errors aren't shared.
copy state so mutations to Until and Errors aren't shared.
// copy state so mutations to Until and Errors aren ' t shared .
func (s *State) copy() *State {
	ns := &State{Code: s.Code}
	if s.Until != nil {
		until := *s.Until
		ns.Until = &until
	}
	for i := range s.Errors {
		ns.Errors = append(ns.Errors, s.Errors[i])
	}
	return ns
}
func ( s * State ) copy ( ) * State { ns := & State { Code : s . Code } if s . Until != nil { until := * s . Until ns . Until = & until } for i := range s . Errors { ns . Errors = append ( ns . Errors , s . Errors [ i ] ) } return ns }
copy state so mutations to Until and Errors aren't shared.
copy state so mutations to Until and Errors aren ' t shared .