go/src/cmd/internal/buildid/rewrite.go

// FindAndHash reads all of r and returns the offsets of occurrences of id.
// While reading, findAndHash also computes and returns
// a hash of the content of r, but with occurrences of id replaced by zeros.
// FindAndHash reads bufSize bytes from r at a time.
// If bufSize == 0, FindAndHash uses a reasonable default.
func FindAndHash(r io.Reader, id string, bufSize int) (matches []int64, hash [32]byte, err error) {}

func Rewrite(w io.WriterAt, pos []int64, id string) error {}

func excludeMachoCodeSignature(r io.Reader) io.Reader {}

func excludeHostBuildID(r, r0 io.Reader) io.Reader {}

type excludedReader

func (r *excludedReader) Read(p []byte) (int, error) {}

func findMachoCodeSignature(r any) (*macho.File, codesign.CodeSigCmd, bool) {}

func findHostBuildID(r io.Reader) (offset int64, size int64, ok bool) {}