code: func parseThreadSample(b *bytes.Buffer) (nextl string, addrs []uint64, err error) {
  	var l string
  	sameAsPrevious := false
  	for {
  		if l, err = b.ReadString('\n'); err != nil {
  			if err != io.EOF {
  				return "", nil, err
  			}
  			if l == "" {
  				break
  			}
  		}
  		if l = strings.TrimSpace(l); l == "" {
  			continue
  		}
  
  		if strings.HasPrefix(l, "---") {
  			break
  		}
  		if strings.Contains(l, "same as previous thread") {
  			sameAsPrevious = true
  			continue
  		}
  
  		addrs = append(addrs, parseHexAddresses(l)...)
  	}
  
  	if sameAsPrevious {
  		return l, nil, nil
  	}
  	return l, 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.