Skip to content

cmd/link, embed: store only one copy of an embedded []byte #52533

@pjebs

Description

@pjebs

I am using the caire package: https://github.com/esimov/caire/blob/master/process.go#L26
It embeds a file called facefinder required for a common dependency called pigo.

My application also uses the pigo package and independently needs to embed the same file.

Currently the same file's data is being embedded twice. Perhaps as an optimisation, it can calculate the hashes of each embedded file (including inside all the dependencies), and store the data only once for duplicates.

This proposal is only for single file embeds and not directories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions