You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
will use the standard errors package that does not support it.
IMHO we should drop this implementation (or specify an Unwrap function for older versions that supports both signatures) since the go.mod specifies go 1.20
and change the Join implementation for newer version of go to be a function that delegate the call to errors package like we do for Unwrap instead specify a public global variable that points to the Join function.
The text was updated successfully, but these errors were encountered:
peczenyj
changed the title
wrong implementation of join functions for older go versions
wrong implementation of Join function for older go versions
Nov 10, 2023
Hello
errors/join.go
Line 54 in 10bc51a
this will not work for go versions older than 1.20
the reason is: unsafe.String was added on 1.20
this code will not compile on go 1.19, for instance
an alternative is to use
unsafe.Pointer
like in the example belowhttps://github.com/valyala/fasthttp/blob/master/b2s_old.go
however there is another issue: the signature of Unwrap method uses a new alternative format (when return an slice of errors)
errors/join.go
Line 57 in 10bc51a
but for older versions of go this
Unwrap
signature:errors/wrap.go
Line 40 in 10bc51a
will use the standard
errors
package that does not support it.IMHO we should drop this implementation (or specify an Unwrap function for older versions that supports both signatures) since the go.mod specifies go 1.20
and change the Join implementation for newer version of go to be a function that delegate the call to errors package like we do for Unwrap instead specify a public global variable that points to the Join function.
The text was updated successfully, but these errors were encountered: