logo-MindMajix
PostGoLangGoLang
c
chris bons

Posted on 16th June 2024|33 views

0
votes

Golang Error Wrap

How to wrap errors

1 answers
Answers
P
sri kanth

Posted on 16th June 2024| views

In Golang, “error” package supports error wrapping directly. To wrap an error, use %w that makes it available to errors.Is and errors.As:

err:= fmt.Errorf("access denied: %w", ErrPermission)

 

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
Name
Course *
Email *
Phone Number