On Thu, Sep 6, 2018 at 1:32 PM mustafa katipoğlu <98mustafakatipo...@gmail.com> wrote: > > check this documentation. https://golang.org/doc/faq#nil_error
Yes, I am aware of that. This is not specific to errors though, this is a problem for any interface return value, and vet could warn against this use. > > 6 Eylül 2018 Perşembe 22:15:17 UTC+3 tarihinde Burak Serdar yazdı: >> >> https://play.golang.org/p/KLXvFNCewyW >> >> Here, f2() never returns nil, because the returned "nil" valued >> interface is of type *int. >> >> It would be really nice if vet could warn if a function returns an >> interface, and there exist a code path in that function where the >> return value is set from a reference. >> >> I've seen a lot of discussions about not returning interfaces, but >> sometimes you just have to do it. > > -- > 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. > For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.