Posted on 16th September 2024|32 views
How to compare errors in Golang
Posted on 16th September 2024| views
Go errors are the values, so we use == to compare errors with a specific value. Use the given syntax to compare error:
err.Error() == "Token is expired"