mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	chore: update go sdk examples (#8145)
This commit is contained in:
		
							parent
							
								
									bca02a05ee
								
							
						
					
					
						commit
						f76f754eca
					
				@ -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: ``,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user