Vendored context errors

173 views
Skip to first unread message

Sameer Ajmani

unread,
Jul 11, 2016, 5:58:52 PM7/11/16
to golang-dev
I've just watched Dave Cheney's Gophercon talk on errors and Wisdom Omoya's talk on vendoring. Based on these, I have a concern about the context package in Go 1.7: the context package exports two error sentinel values, context.Canceled and context.DeadlineExceeded. Currently people probably vendor the x/net/context package. In Go1.7, they should switch to using the standard one. But the standard context.Canceled value != a context.Canceled from a vendored context package. Will this cause problems?

Brad Fitzpatrick introduced this fix in x/net/context when built with Go1.7:
https://github.com/golang/net/blob/master/context/go17.go
Is this sufficient?

There are also related discussions in https://github.com/golang/go/issues/16209 (closed) and https://github.com/golang/go/issues/8082.

S
Reply all
Reply to author
Forward
0 new messages