Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use //go:embed from Go 1.16 #381

Closed
simon04 opened this issue Feb 19, 2021 · 7 comments
Closed

Use //go:embed from Go 1.16 #381

simon04 opened this issue Feb 19, 2021 · 7 comments

Comments

@simon04
Copy link
Contributor

simon04 commented Feb 19, 2021

https://golang.org/pkg/embed/

Package embed provides access to files embedded in the running Go program.

Go source files that import "embed" can use the //go:embed directive to initialize a variable of type string, []byte, or FS with the contents of files read from the package directory or subdirectories at compile time.

https://golang.org/doc/go1.16#library-embed

@salemhilal
Copy link
Contributor

Hey! Just to clarify, are you proposing that this replaces ui/bindata.go and the go-bindatapackage?

@simon04
Copy link
Contributor Author

simon04 commented Mar 30, 2021

Exactly, yes.

@salemhilal
Copy link
Contributor

Ok, cool. We aren't going to prioritize this for the time being, but we are open to a PR.

@inglor
Copy link

inglor commented May 4, 2023

Is this even considered There are two PRs raised against this last two years with no merge.

@salemhilal
Copy link
Contributor

@inglor it is being considered. Alas, there are only a few of us, and we all have full-time jobs and have had a rocky few years. Thanks for being patient with us.

@moson-mo
Copy link
Contributor

moson-mo commented May 4, 2023

Seems like the main blocker is that with the switch to embed, a simple go install ... won't work anymore / people would need to have npm installed as well when compiling hound?

I'd agree with 3 points mentioned here: #430 (comment)

Regarding Commit the ui build artifacts to the repo:
That's actually what's already happening with bindata.go. Switching to embed would just shift that to different files.
(which I find somewhat dangerous. It's much easier to hide malicious stuff in "binified" go files or minified JS 😉; those build artifacts should not be part of the repo)

@dschott68
Copy link
Contributor

resolved by #460 and thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants