mirror of
https://github.com/Unleash/unleash.git
synced 2025-04-10 01:16:39 +02:00
Joined all examples into one copyable example. Did not do following ones, because they are using templates and probably will not work as joined. 1. React 2. Svelte 3. Vue Also skipped, because those examples are not final yet. 1. .NET 2. Android 
636 B
636 B
1. Install the SDK
go get github.com/Unleash/unleash-client-go/v3
2. Run Unleash
import (
"github.com/Unleash/unleash-client-go/v3"
"net/http"
"time"
)
func init() {
unleash.Initialize(
unleash.WithListener(&unleash.DebugListener{}),
unleash.WithAppName("unleash-onboarding-golang"),
unleash.WithUrl("<YOUR_API_URL>"),
unleash.WithCustomHeaders(http.Header{"Authorization": {"<YOUR_API_TOKEN>"}}),
unleash.WithMetricsInterval(5*time.Second),
)
}
func main() {
for {
unleash.IsEnabled("<YOUR_FLAG>")
time.Sleep(time.Second)
}
}