Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Akshay Bharambe akshaybharambe14

🎯
Focusing
View GitHub Profile
@akshaybharambe14
akshaybharambe14 / main.go
Created Apr 18, 2020 — forked from creack/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
View main.go
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
@akshaybharambe14
akshaybharambe14 / context_cancel.go
Created Jan 25, 2020 — forked from fracasula/context_cancel.go
GoLang exiting from multiple go routines with context and wait group
View context_cancel.go
package main
// Here we show how to properly terminate multiple go routines by using a context.
// Thanks to WaitGroup we'll be able to end all go routines gracefully before the main function ends.
import (
"fmt"
"os"
"context"
"sync"
View synccondsimple.go
package main
import (
"fmt"
"os"
"os/signal"
"sync"
"time"
)
You can’t perform that action at this time.