Yes, I agree. It seems to have trouble inferring types when the argument is a generic interface type. Here's a simpler example: https://go2goplay.golang.org/p/3-aVhD6Y9R2 I think this is probably https://github.com/golang/go/issues/39661
cheers, rog. On Thu, 18 Jun 2020 at 02:14, Denis Cheremisov <denis.cheremi...@gmail.com> wrote: > Better example. A method to request for exacly one element from the gRPC > bistream. A thing that is frequently needed when there're lots of bistream > gRPC methods. > > https://go2goplay.golang.org/p/RQEyhRRQb0p > > IRL I would need to call it as > > resp, err := proto.ReadOne(service.Service_MethodClient, > service.MethodRequest, service.MethodResponse)(ctx, client.Method, > &service.MethodRequest{ > … > }) > > instead of simple to read > > resp, err := proto.ReadOne(ctx, client.Method, &service.MethodRequest{ > … > }) > > среда, 17 июня 2020 г., 19:43:35 UTC+3 пользователь Denis Cheremisov > написал: >> >> https://go2goplay.golang.org/p/ObL79WVHDjw >> >> Need to write types explicitly although all the info needed is easily >> accessible: >> >> fmt.Println(IsOK(*commonResponse, *commonError)(r)) >> >> What I am sure is I will keep using a code generator instead of this >> monstrosity. >> > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/6bfdcc4c-dca8-4051-b89c-65274c2f6982o%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/6bfdcc4c-dca8-4051-b89c-65274c2f6982o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAJhgacj-5v%2BvTa0zx6xU1ir_ebJC8mnYQY7HYMU0YiLYtSevJA%40mail.gmail.com.