V
V
veryoriginalnickname2021-08-11 21:31:07
go
veryoriginalnickname, 2021-08-11 21:31:07

| in function arguments?

In JS you can do this:

public addError(error: E_UNKNOWN | E_CUSTOM | E_AUTH_INCORRECT){

}

This won't work
AddError(unknown *EUnknown | *Ecustom) <- ошибка
in Go. How can this be done in Go?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2021-08-11
@veryoriginalnickname

No way, in Go, in principle, there is no polymorphism in any form, duck typing does not count

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question