0xBF
0xBF

0xBF

Go Cheatsheet - Format Errors

0xBF's photo
0xBF

Published on 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