prajaut

prajaut

Golang Error Handling blog post

Being a part of the tech industry, it would be good to share thoughts on specific technologies.

Having surrounded by skilled and experienced Golang developers, I have thought why not to share their thoughts in the community to utilise the information.

So, sharing an interesting topic on Golang.

Blogpost: Golang Error Handling- Way of Handling Errors

This blog outlines the basics of Golang Error Handling with examples and why is it having a better approach than other languages.

Do read this blogpost and understand how it is better than other languages, and a high overview of panic and recover mechanism.

/go

Most Liked

OvermindDL1

OvermindDL1

Doesn’t that mean that they are pretty trivial to accidentally (or purposefully) ignore? Sounds bad for maintainability? Plus what about issues like an error value able to be a slim pointer null, a fat pointer null (which won’t compare to null correctly), or an error itself? And what is the state of the first return value when the error has happened? Does it still contain useful information? Is it garbage? If it’s garbage then why does it exist at all? If it “depends on the call” then why isn’t that told by the types?

Just a tiny tiny sampling of reasons why every language need sum types. Just having prod types like structs is insufficient, need sum types as well, like variants.

herbertj

herbertj

Thanks for the blog, GoLang have support for errors in a really simple way. Go functions return errors as a second return value.

Where Next?

Popular Backend topics Top

First poster: bot
When I need to configure something in a complicated way, I find myself reviewing the embedded language that provided the server to create...
New
First poster: bot
Such inflammatory, much wow. Unfortunately, Haskell itself agrees. Some languages naturally lend themselves towards adoption. Some don’t...
New
First poster: bot
Julia is a scientific programming language that is free and open source.1 It is a relatively new language that borrows inspiration from l...
New
AstonJ
Just finished doing a clean install of macOS (which I highly recommend btw!) and have updated my macOS Ruby & Elixir/Erlang dev env s...
New
paulanthonywilson
Post on using UDP multicasting with Elixir to broadcast presence, and listen for peers, on a local network. I have found this approach us...
New
First poster: bot
Like, on a scale from c to rust? issue c zig (release-safe) rust (release) out-of-bounds heap read/write none runtime runtime ...
New
First poster: bot
I discovered Elixir and Go at about the same time (2019). I had pivoted almost eight years of working as a Java developer, and part of me...
New
First poster: bot
This post is a spiritual successor to Loris Cro’s Go cross-compilation. The encounter During a recent stage 2 meeting Jakub Konka wanted...
New
New
wolf4earth
Tej Pochiraju joins the mix to discuss Progressive Web Apps and how you can support them using Elixir and Phoenix to control IoT devices....
New

Other popular topics Top

AstonJ
Or looking forward to? :nerd_face:
New
PragmaticBookshelf
Design and develop sophisticated 2D games that are as much fun to make as they are to play. From particle effects and pathfinding to soci...
New
AstonJ
Curious to know which languages and frameworks you’re all thinking about learning next :upside_down_face: Perhaps if there’s enough peop...
New
Rainer
Not sure if following fits exactly this thread, or if we should have a hobby thread… For many years I’m designing and building model air...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
Maartz
Hi folks, I don’t know if I saw this here but, here’s a new programming language, called Roc Reminds me a bit of Elm and thus Haskell. ...
New
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New