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

Scorpil
I dabbled in Phoenix for a while now, but never really got my hands dirty with it right up until now. Apart from the whole framework bein...
New
AstonJ
This article was written by @rvirding …over a decade ago! Posting here in case anyone else finds it of interest and adding it to our Erla...
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
paulanthonywilson
So you’re enjoying using WebSockets with Elixir’s Phoenix Framework, and you want to send some binary messages. Maybe it’s an audio clip,...
New
First poster: bot
One of my favourite programming languages in the last few years has been Crystal. While the language has not yet reached its 1.0 version,...
New
First poster: bot
Over the last few years, due in large part to the hype surrounding blockchain and cryptocurrencies, decentralized applications have gaine...
New
First poster: bot
Creation vs. Evolution Consider the history of Elixir: first you take Erlang, which was invented by Joe Armstrong and team to solve the ...
New
First poster: bot
Once a year, I look back at the recent developments in the PHP world, and also look forward to what’s to come. And just like in 2020 and ...
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

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
wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
axelson
I’ve been really enjoying obsidian.md: It is very snappy (even though it is based on Electron). I love that it is all local by defaul...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
PragmaticBookshelf
Learn different ways of writing concurrent code in Elixir and increase your application's performance, without sacrificing scalability or...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
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
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
PragmaticBookshelf
A Ruby-Centric Chat with Noel Rappin @noelrappin Once you start noodling around with Ruby you quickly figure out, as Noel Rappi...
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New