Hacker News new | ask | show | jobs
by fuckstick 1329 days ago
You are gravely mistaken. MustCompile* if it fails panics at runtime. Go doesn’t have a general purpose compile time execution feature.

That’s all Must does - is make runtime panic look nice.

* MustCompile if you are unfamiliar - the compile refers to the compilation of the regular expression - which is always done at runtime.

1 comments

Ah yeah i was remembering wrong. I normally have this setup as a package level variable and then build and test. But yes its on the test that it’s actually caught