0xBF
0xBF

Follow

0xBF

Follow

Go Cheatsheet - Format Errors

0xBF's photo
0xBF
·Apr 22, 2021·

1 min read

Errors

Return simple error string

return errors.New("Invalid Parameter")

Return string with format

return fmt.Errorf("user %q (id %d) not found", name, id)
 
Share this