Skip to content

Go code experiments for providing constant sentinel error values

License

Notifications You must be signed in to change notification settings

nelz9999/go-sentinel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-sentinel

Go code experiments for providing constant sentinel error values

Inspiration

As someone who isn't super well-informed about programming language design, I spend a lot of time reading the output of other people who are, and specifically I find Dave Cheney's writing to be super approachable and valuable.

In addition to having the privileged of a lot of time to read blogs, I also have time to write small code projects, and after reading Dave's blog post about constant errors, I thought I'd knock out the reference code, even if this pattern was declared to be not the best practice.

I also tried to see if I could come up with a way to address a concern with this pattern that was raised on the (now closed) proposal to add this pattern to the standard library. (It turns out the string equality concern does not seem to be structurally fixable within Go, and falls back to relying on best practices and conventions for descriptive error messages.)

About

Go code experiments for providing constant sentinel error values

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages