3 ms·
> we have to use if to convert bools into bits. What if you can use the unsafe package?
by AlexCoventry 5y ago
> we have to use if to convert bools into bits.
What if you can use the unsafe package?
- gnum4n 5y agoIn that case, the code would probably work like the C code example I gave. So... I guess you're right. It _can_ be done in Go without `if` if we use unsafe. I can't argue with that =) In general, I try to to avoid using unsafe as much as possible. Not because I worry that it's "unsafe" or prone to errors (I'm experienced in C, C++, and assembly), but because it makes the code harder to read, and I don't think my coworkers would appreciate that. ;)