Axel Wagner writes:
> I feel like https://go2goplay.golang.org/p/RLn9BXjU1OR is a better
> compromise than having two functions.
> Prolly. Except OP specifically asked about "not that" :)
Agreed on both counts.
--
You received this message because you are subscribed to the Google Group
Prolly. Except OP specifically asked about "not that" :)
On Tue, Aug 4, 2020 at 5:30 PM Andrei Tudor Călin wrote:
> I feel like https://go2goplay.golang.org/p/RLn9BXjU1OR is a better
> compromise than having two functions.
>
> On Tue, Aug 4, 2020 at 5:50 PM 'Axel Wagner' via golang-nuts <
> gola
I feel like https://go2goplay.golang.org/p/RLn9BXjU1OR is a better
compromise than having two functions.
On Tue, Aug 4, 2020 at 5:50 PM 'Axel Wagner' via golang-nuts <
golang-nuts@googlegroups.com> wrote:
> No, that's not possible. A generic function can only work with *either*
> built in operato
No, that's not possible. A generic function can only work with *either*
built in operators *or* methods. So, you always need to have two functions:
https://go2goplay.golang.org/p/YuzSzDAOEo2
On Tue, Aug 4, 2020 at 4:32 PM Juliusz Chroboczek wrote:
> I'd be grateful if people could give me an ex
I'd be grateful if people could give me an example to help me understand
the generics draft. Suppose I've got these two functions:
func MemberInt(x int, a []int) bool {
for _, v := range a {
if v == x {
return true
}
}