Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Use Go embed.FS instead of external tool to embed assets #135

Merged
merged 4 commits into from
Jul 23, 2021

Conversation

thomasf
Copy link
Contributor

@thomasf thomasf commented Jul 11, 2021

embed.FS is new i Go 1.16 so updated go.mod and ran go mod tidy as well.

@thomasf thomasf requested a review from suom1 as a code owner July 11, 2021 17:58

var fsys fs.FS = assetsFS
if f, err := fs.Sub(fsys, "ui/dist"); err != nil {
log.Error(fmt.Errorf("ui/dist does not exist in fs :%w", err))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will never execute as the program as specified now because go:embed ui/dist fill fail the compilation if it does not exist. Just error printing the error to be safe is something changes.

@suom1
Copy link
Member

suom1 commented Jul 19, 2021

Awesome stuff, I will during this week look at why the actions runner keeps using 1.15.x instead of latest golang.

@suom1 suom1 merged commit 4f57eac into EmbarkStudios:main Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants