简体   繁体   中英

Packing multiple images into a GOLANG binary

GOLANG gurus:

I know this might seem illogical, but here it goes.

I have to distribute a binary (which in this case would be a webserver) to other engineers for testing. To keep it simple, because they might not be developers, I wanted to see if there might be some automated way to pack images into a GOLANG binary ? I've done this static HTML pages in the past, and it works great.

Obviously, at first run I could unzip to the file system, but to keep things clean I was trying to see if anyone has any thoughts how I could stuff them into a binary.

Any Ideas ?

You could use the same tools you used for HTML files... I'm assuming you used something like:

Which essentially transform your files in go source code and the expose an http.FileSystem-like API for reading your data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM