code: func parseThreadSample(s *bufio.Scanner) (nextl string, addrs []uint64, err error) {
  	var line string
  	sameAsPrevious := false
  	for s.Scan() {
  		line = strings.TrimSpace(s.Text())
  		if line == "" {
  			continue
  		}
  
  		if strings.HasPrefix(line, "---") {
  			break
  		}
  		if strings.Contains(line, "same as previous thread") {
  			sameAsPrevious = true
  			continue
  		}
  
  		curAddrs, err := parseHexAddresses(line)
  		if err != nil {
  			return "", nil, fmt.Errorf("malformed sample: %s: %v", line, err)
  		}
  		addrs = append(addrs, curAddrs...)
  	}
  	if err := s.Err(); err != nil {
  		return "", nil, err
  	}
  	if sameAsPrevious {
  		return line, nil, nil
  	}
  	return line, addrs, nil
  }
docs: // parseThreadSample parses a symbolized or unsymbolized stack trace.
  // Returns the first line after the traceback, the sample (or nil if
  // it hits a 'same-as-previous' marker) and an error.