Skip to content

Instantly share code, notes, and snippets.

View kamal-github's full-sized avatar
:octocat:
Focusing

Kamal Namdeo kamal-github

:octocat:
Focusing
View GitHub Profile
@aalemayhu
aalemayhu / gs_gofmt.bash
Created March 17, 2017 09:36
Run gofmt on changed files
for x in `git status -s|awk '{ print $2}'`; do gofmt -w $x; done
@kamal-github
kamal-github / ZshSetup.md
Last active October 16, 2018 14:50
Zsh Setup with Ohmyzsh
@ribice
ribice / caller.go
Last active January 6, 2025 07:14
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@kamal-github
kamal-github / OrDoneChannel.go
Last active November 22, 2020 08:27
Or Done channel - Concurrency in Go Book
package main
import (
"fmt"
"time"
)
// Simpler version for Or
func OrVer2(ch ...chan struct{}) <-chan struct{} {
switch len(ch) {
@kamal-github
kamal-github / fan-out-in.go
Last active November 21, 2020 17:00
Fan out and Fan in pattern in Go
package main
import (
"fmt"
"runtime"
"sync"
)
func main() {
// can be a input stream such as CSV/Network/File.