1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-18 00:19:49 +01:00

chore: update go sdk examples (#8145)

This commit is contained in:
Jaanus Sellin 2024-09-16 13:15:26 +03:00 committed by GitHub
parent bca02a05ee
commit f76f754eca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,6 +40,8 @@ const unleash = initialize({
`, `,
Go: `import ( Go: `import (
"github.com/Unleash/unleash-client-go/v3" "github.com/Unleash/unleash-client-go/v3"
"net/http"
"time"
) )
func init() { func init() {
@ -48,6 +50,7 @@ func init() {
unleash.WithAppName("unleash-onboarding-golang"), unleash.WithAppName("unleash-onboarding-golang"),
unleash.WithUrl("<YOUR_API_URL>"), unleash.WithUrl("<YOUR_API_URL>"),
unleash.WithCustomHeaders(http.Header{"Authorization": {"<YOUR_API_TOKEN>"}}), unleash.WithCustomHeaders(http.Header{"Authorization": {"<YOUR_API_TOKEN>"}}),
unleash.WithMetricsInterval(5*time.Second),
) )
}`, }`,
Ruby: `Unleash.configure do |config| Ruby: `Unleash.configure do |config|
@ -192,7 +195,13 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
console.log('Is enabled', unleash.isEnabled('<YOUR_FLAG>')); console.log('Is enabled', unleash.isEnabled('<YOUR_FLAG>'));
}, 1000); }, 1000);
`, `,
Go: ``, Go: `func main() {
for {
unleash.IsEnabled("<YOUR_FLAG>")
time.Sleep(time.Second)
}
}, 1000);
`,
Ruby: ``, Ruby: ``,
PHP: ``, PHP: ``,
Rust: ``, Rust: ``,