In standard go you would not implement Is but would use the errors.Is call. How would this work if it is a sentinel error as you would use with errors.Is??
> An error is considered to match a target if it is equal to that target or if it implements a method Is(error) bool such that Is(target) returns true.
by default errors.Is matches the exact error variable, but you can use it to match other errors as well.
I stand corrected. Still you cannot implement an Is on a sentinel error and is only applicable to concrete error types. And if I'm using concrete types I'm going to us errors.As
They are my daily bread and I sloppily lumped them in with "web [...] services", but in hindsight they ought to be a separate category - fundamentally about a different layer,infrastructure, and might not even be networked.
Many tools on DevOps ecosystem are now going through the RIIR phenomenon, and I bet, had Rust 1.0 been available when Kubernetes decided to migrate away from Java, after Go heads joined the team (see FOSDEM talk on the matter), or Docker moving away from Python, most of those tools would have been written in Rust instead.
The Rust of today wouldn't be chosen over the Go of a decade ago, it is fundamentally a bad fit, for similar reasons that the already mature C++ wasn't. Java (similar to C#) would've been viable mainly due to maturity and ecosystem effects, Kotlin/Native might be a contender in another half decade, sooner if the team were to shift priorities.
I say this not just for Kubernetes etc., but greenfield projects today as well.
Let's just entertain the idea and pretend that this is a notable project and that one would count it as DevOps tooling.
Here are the top 10 across the CNCF in terms of size, courtesy of GitHub's API:
the values are specified in the definition of the iota type.
```
type planet int // Gravity[float64],RadiusKm[float64],MassKg[float64],OrbitKm[float64],OrbitDays[float64],SurfacePressureBars[float64],Moons[int],Rings[bool]
```
yeah, and now, mentally count how many values you are in, don't lose count now! Why offload that to your brain where you could miscount instead of using structured data?
Because your whole argument is misconstructed. There are cases where longer code is better, but there are many cases where longer is worse too. Because the tools the language provide, on top of being more succint, make the intent more obvious.
DSL? The go way is to use go generate I would say and it can be used with go:generate, I would like to use the AST lib to parse go files to remove the need for any json and to be more like the cmd stringer tool.
I'm not sure I understand exactly what you mean, but you can combine go:generate with go run so you can execute code from the current module/project that does what you want.
//go:generate go run ./internal/enumhelper -flag1 -flag2