Get the latest tech news
Prep: Golang Comptime
Golang comptime. Pure blasphemy. Contribute to pijng/prep development by creating an account on GitHub.
Compile-Time Evaluation: Replace function calls with their computed results at build time. This command will evaluate all functions wrapped with prep.Comptime and replace them with their computed results during the build. Only functions that can be fully resolved with the provided literal arguments can be evaluated at compile-time, therefore it is impossible to use any values from IO operations.
Or read this on Hacker News