| ▲ | fastest963 4 days ago | |||||||||||||
I'm not sure there's a realistic alternative. If you need to generate a key then it has to happen somehow on unsupported platforms. You can check Enabled() if you need to know and intend to do something different but I assume most of the time you run the same function either way you'd just prefer to opt into secret mode if it's available. | ||||||||||||||
| ▲ | kbolino 13 hours ago | parent | next [-] | |||||||||||||
This is not what secret.Enabled() means. But it probably illustrates that the function needs to be renamed already. Here's what the doc comment says:
In other words, it is just a way of checking that you are indeed running inside the context of some secret.Do call; it doesn't guarantee that secret.Do is actually offering the protection you may desire. | ||||||||||||||
| ||||||||||||||
| ▲ | awithrow 4 days ago | parent | prev [-] | |||||||||||||
Why not just panic and make it obvious? | ||||||||||||||
| ||||||||||||||