4 ms·
Author here. I just removed the previous section I had around using build tags because I realized I was using `// +build 1.18` instead of the correct `// +build
by bullcitydev 5y ago
Author here. I just removed the previous section I had around using build tags because I realized I was using `// +build 1.18` instead of the correct `// +build go1.18`. Oops.
- travisd 5y agoFYI: Looks like code blocks are unreadable on mobile (probably a overflow: hidden CSS rule somewhere that truncates lines and doesn’t let you scroll).
- bullcitydev 5y agothanks! I'll check it out!
- bullcitydev 5y agoJust fixed it. Thanks again!
- grey-area 5y agoShame build tags aren't part of the language with a proper syntax check instead of magic comments.
- giovannibajo1 5y agoCan you show me an example of a language that does syntax checking of build-system related directives at compile time?
- grey-area 5y agoC++ #pragma, #include? Golang import statements? I see why they did this for the Go 1 guarantee, but would prefer if they used a keyword and had a defined restricted syntax for it. There are a growing number of these comments and they’re poorly documented and spread around different tooling. It’s kind of a hack. https://blog.jbowen.dev/2019/09/the-magic-of-go-comments/ https://blog.jbowen.dev/2019/09/the-magic-of-go-comments/
- kevin_thibedeau 5y agoNim. C++ attributes (coming soon to C).
- Groxx 5y agoZig. Rust. The others in this thread. There are quite a few. Go chose possibly the weakest-safety option of them all.