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

New
First poster: bot
Part 1: Introduction to Postgrest. In Codd, we trust In the field of Computer Science and Engineering, few things come close to the dura...
New
New
First poster: bot
Why Zig When There is Already C++, D, and Rust? No hidden control flow No hidden allocations First-class support for no standard library...
New
First poster: bot
In a previous post we talked about implementing a simple video chat with WebRTC and Elixir. This update will touch on some of the API cha...
New
AstonJ
If you’re interested in Rust this is worth a read :smiley: Technology from the past come to save the future from itself Hi I have be...
New
First poster: bot
Just a small test with lists in cython. Considering echosystem, multithreading and ease of use, Julia is a clear winner here.
New
CommunityNews
This thread was posted by one of our members via one of our news source trackers.
New
chikega
Mark Hoffman, the author of Programming WebAssembly in Rust, is a pretty hilarious lecturer if you like a dry sense of humor.
New
brainlid
In episode 78 of Thinking Elixir, we talk with Chase Granberry about Logflare. We learn why Chase started the company, what Logflare does...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1021 17094 374
New
AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
ohm
Which, if any, games do you play? On what platform? I just bought (and completed) Minecraft Dungeons for my Nintendo Switch. Other than ...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
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
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New