logo-MindMajix
PostGoLangGoLang
A
Athiq mohd

Posted on 23rd June 2024|3993 views

0
votes

Golang Convert Error To String

How can I convert an error to a string?

1 answers
Answers
P
sumana reddy

Posted on 23rd June 2024| views

The error type contains an interface in Go

type error interface {

    Error() string

}

Thus, for an error err, you can call

err.Error()

 

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