code: func GetBuildID(binary io.ReaderAt) ([]byte, error) {
  	f, err := elf.NewFile(binary)
  	if err != nil {
  		return nil, err
  	}
  
  	findBuildID := func(notes []elfNote) ([]byte, error) {
  		var buildID []byte
  		for _, note := range notes {
  			if note.Name == "GNU" && note.Type == noteTypeGNUBuildID {
  				if buildID == nil {
  					buildID = note.Desc
  				} else {
  					return nil, fmt.Errorf("multiple build ids found, don't know which to use")
  				}
  			}
  		}
  		return buildID, nil
  	}
  
  	for _, p := range f.Progs {
  		if p.Type != elf.PT_NOTE {
  			continue
  		}
  		notes, err := parseNotes(p.Open(), int(p.Align), f.ByteOrder)
  		if err != nil {
  			return nil, err
  		}
  		if b, err := findBuildID(notes); b != nil || err != nil {
  			return b, err
  		}
  	}
  	for _, s := range f.Sections {
  		if s.Type != elf.SHT_NOTE {
  			continue
  		}
  		notes, err := parseNotes(s.Open(), int(s.Addralign), f.ByteOrder)
  		if err != nil {
  			return nil, err
  		}
  		if b, err := findBuildID(notes); b != nil || err != nil {
  			return b, err
  		}
  	}
  	return nil, nil
  }
docs: // GetBuildID returns the GNU build-ID for an ELF binary.
  //
  // If no build-ID was found but the binary was read without error, it returns
  // (nil, nil).