Skip to content

proposal: embed: add string array and string maps #69731

Closed as not planned
Closed as not planned
@ZiViZiViZ

Description

@ZiViZiViZ

Proposal Details

I am aware of the embed.FS function, however, I feel like it will be more efficient to just use a map or array instead of a complete FS.
In addition, this will simplify the code which is one of Go's goal.

package example

import (
	"embed"
)

//go:embed file1 file2 file2 ...
var fileContentsMap map[string]string // key would be file name while value is the file's content

//go:embed file1 file2 file2 ...
var fileContentsArrays []string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions