Post

GoLangGoLang

c
chris bons

Posted on 28th February 2024|28 views

0
votes

Golang Compare Errors

How to compare errors in Golang

Answers
P
sri kanth

Posted on 28th February 2024

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"

 

Write your answer

STILL GOT QUERIES?

Get a Live FREE Demo
  • Explore the trending and niche courses and learning maps
  • Learn about tuition fee, payment plans, and scholarships
  • Get access to webinars and self-paced learning videos