On Wed, Oct 26, 2022 at 9:17 PM sick...@gmail.com
wrote:
> Consider a scenario where you want to embed an error within any type of
> variable.
>
> This can be achieved by embedding any in a struct and it seems to be a
> valid syntax in Go 1.9.
> type WithError struct {
> any
>
Consider a scenario where you want to embed an error within any type of
variable.
This can be achieved by embedding any in a struct and it seems to be a
valid syntax in Go 1.9.
type WithError struct {
any
err error
}
func main() {
a := WithError{ any: 5,