Skip to content

Instantly share code, notes, and snippets.

View GGCristo's full-sized avatar
🔬
Alway learning

Cristo García GGCristo

🔬
Alway learning
View GitHub Profile
@GGCristo
GGCristo / errHdl_proposal.md
Last active July 13, 2022 03:05
Simple Error Handling for Go 2. Part 2

This is my own iteration that build upon PeterRk's proposal. https://gist.github.com/PeterRK/4f59579c1162cdbc28086f6b5f7b4fa2
The idea is to reduce if err != nil {} boilerplate while not encouraging developers to write lazy error handling.

Go must still be Go

For me, this means:

  • Add as little syntax as possible
  • Be as explicit as convenient

Original idea

The user PeterRk proposed the next syntax:

func getDivisorFromDB(key string) (uint, error) {
This file has been truncated, but you can view the full file.
[ START ] 2021-07-12T19:36:08+0100 ] LSP logging initiated
[ START ] 2021-07-12T19:36:22+0100 ] LSP logging initiated
[ START ] 2021-07-13T00:31:54+0100 ] LSP logging initiated
[ START ] 2021-07-17T02:00:23+0100 ] LSP logging initiated
[ START ] 2021-07-17T01:59:53+0100 ] LSP logging initiated
[ START ] 2021-07-17T02:00:30+0100 ] LSP logging initiated
[ START ] 2021-07-17T02:00:53+0100 ] LSP logging initiated
[ START ] 2021-07-17T02:03:04+0100 ] LSP logging initiated
[ START ] 2021-07-17T02:03:14+0100 ] LSP logging initiated
#alias for git
alias gcl='git clone'
alias ga='git add'
alias grm='git rm'
alias grmc='git rm --cached'
alias gap='git add -p'
alias gall='git add -A'
alias gf='git fetch --all --prune'
alias gft='git fetch --all --prune --tags'
alias gfv='git fetch --all --prune --verbose'