I think that in general you will have to only use features available to Go 1.11, meaning, of course, that the new methods in the errors package would be off limits. In the mean time you could use golang.org/x/xerrors, which is a superset of the new errors package and I believe will work with 1.11.
On Fri, Sep 6, 2019, 7:50 AM changkun <euryugas...@gmail.com> wrote: > I have upgraded my code to Go 1.13 with newly introduced errors APIs. > > However, I am not able to upgrade the production environment Go version > which is Go 1.11, which means I have to run Go 1.13 code on a Go 1.11 > environment. > > What are the way to make my builds both happy on local and production > environment with a single code base? > > -- > 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/0a915d38-39f4-4083-b730-75320a4eecc6%40googlegroups.com > <https://groups.google.com/d/msgid/golang-nuts/0a915d38-39f4-4083-b730-75320a4eecc6%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/CAA%3DXfu1cXxzt7B4L%2B7sHw%3DxT-%2BA5J44n1PdtszQ%3DxTAoJOwU_g%40mail.gmail.com.