code: func parseDump(r io.Reader, out io.Writer) ([]*Goroutine, error) {
  	scanner := bufio.NewScanner(r)
  	scanner.Split(scanLines)
  	s := scanningState{}
  	for scanner.Scan() {
  		line, err := s.scan(scanner.Text())
  		if line != "" {
  			_, _ = io.WriteString(out, line)
  		}
  		if err != nil {
  			return s.goroutines, err
  		}
  	}
  	return s.goroutines, scanner.Err()
  }
docs: // Private stuff.