Hacker News new | past | comments | ask | show | jobs | submit login

Which time golang read file, build time or run time ?



embed package allows to embed assets directly into the binary, so the files are read once during build time and then you can access them as e.g. a byte slice, a string, or a special FS object that acts like an in-memory file system


Build time


Build time. It literally embeeds the file in the binary.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: