Skip to content

Commit

Permalink
chore: update go sdk examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sjaanus committed Sep 16, 2024
1 parent 12c8e73 commit 473e345
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/component/onboarding/sdkSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const unleash = initialize({
`,
Go: `import (
"github.com/Unleash/unleash-client-go/v3"
"net/http"
"time"
)
func init() {
Expand All @@ -48,6 +50,7 @@ func init() {
unleash.WithAppName("unleash-onboarding-golang"),
unleash.WithUrl("<YOUR_API_URL>"),
unleash.WithCustomHeaders(http.Header{"Authorization": {"<YOUR_API_TOKEN>"}}),
unleash.WithMetricsInterval(5*time.Second),
)
}`,
Ruby: `Unleash.configure do |config|
Expand Down Expand Up @@ -192,7 +195,13 @@ export const checkFlagCodeSnippets: Record<SdkName, string> = {
console.log('Is enabled', unleash.isEnabled('<YOUR_FLAG>'));
}, 1000);
`,
Go: ``,
Go: `func main() {
for {
unleash.IsEnabled("<YOUR_FLAG>")
time.Sleep(time.Second)
}
}, 1000);
`,
Ruby: ``,
PHP: ``,
Rust: ``,
Expand Down

0 comments on commit 473e345

Please sign in to comment.