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.

Popular Backend topics Top

New
First poster: wolf4earth
Understanding Partial Moves in Rust. Partial moves are an interesting but often misunderstood feature of Rust. However, with the right ...
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
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: dimitarvp
I’ve spent the last year building keyboards, which has included writing firmware for a variety custom circuit boards. I initially wrote ...
New
paulanthonywilson
Following up on the previous post on using UDP multicasting to broadcast and detect peers on a network, I create a registry of those peer...
New
First poster: brennan
The perspective of an ignorant computer science undergrad It’s likely that you read the title of this post and thought “what is this guy ...
New
First poster: bot
At Grammarly, the foundation of our business, our core grammar engine, is written in Common Lisp. It currently processes more than a thou...
New
axelson
I describe how we use Hot Reloading with Webpack to develop faster and show how to integrate Webpack 5, webpack-dev-server, and Phoenix f...
New
StuntProgrammer
In building lofi.limo, media storage and distribution naturally came up. I have songs, announcements, and background image loops which I ...
New

Other popular topics Top

Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
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
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
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 Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New