Re: [go-nuts] How to do a forward compatibility support for go 1.13?

2019-09-06 Thread Marcin Romaszewicz
This may not be the exact answer you're looking for, but there's a package
which handles this even better than Go's builtin error package:

https://github.com/pkg/errors

Dave Cheney's package is better designed, IMO, and the explicit
errors.Wrap() call is more clear than inferring it from your format string.

-- Marcin


On Fri, Sep 6, 2019 at 7:50 AM changkun  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
> 
> .
>

-- 
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/CA%2Bv29LtD9MbOjkoJh7r2X--jWgi8QWY7gB933C0dQxxYVPdNSA%40mail.gmail.com.


Re: [go-nuts] How to do a forward compatibility support for go 1.13?

2019-09-06 Thread Tyler Compton
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  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
> 
> .
>

-- 
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.


[go-nuts] How to do a forward compatibility support for go 1.13?

2019-09-06 Thread changkun
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.