From 8470f8e40241f9a94b2b1e7a4d217e92a5b8dd51 Mon Sep 17 00:00:00 2001 From: Neil Kakkar Date: Fri, 15 Mar 2024 11:03:56 +0000 Subject: [PATCH] clean --- examples/capture.go | 3 ++- examples/featureflags.go | 17 +++++++---------- examples/main.go | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/examples/capture.go b/examples/capture.go index d5bc303..9b46913 100644 --- a/examples/capture.go +++ b/examples/capture.go @@ -2,8 +2,9 @@ package main import ( "fmt" - "github.com/posthog/posthog-go" "time" + + "github.com/posthog/posthog-go" ) func TestCapture() { diff --git a/examples/featureflags.go b/examples/featureflags.go index c965d25..72a9705 100644 --- a/examples/featureflags.go +++ b/examples/featureflags.go @@ -9,12 +9,13 @@ import ( func TestIsFeatureEnabled() { client, _ := posthog.NewWithConfig("phc_36WfBWNJEQcYotMZ7Ui7EWzqKLbIo2LWJFG5fIg1EER", posthog.Config{ - Interval: 30 * time.Second, - BatchSize: 100, - Verbose: true, - PersonalApiKey: "phx_n79cT52OfsxAWDhZs9j3w67aRoBCZ7l5ksRRKmAi5nr", - Endpoint: "http://localhost:8000", - FeatureFlagRequestTimeout: 3 * time.Second, + Interval: 30 * time.Second, + BatchSize: 100, + Verbose: true, + PersonalApiKey: "phx_n79cT52OfsxAWDhZs9j3w67aRoBCZ7l5ksRRKmAi5nr", + Endpoint: "http://localhost:8000", + DefaultFeatureFlagsPollingInterval: 5 * time.Second, + FeatureFlagRequestTimeout: 3 * time.Second, }) defer client.Close() @@ -28,7 +29,6 @@ func TestIsFeatureEnabled() { if boolErr != nil || boolResult == nil { fmt.Println("error:", boolErr) - // return } // Simple flag @@ -40,7 +40,6 @@ func TestIsFeatureEnabled() { fmt.Println("simpleResult:", simpleResult) if simpleErr != nil || simpleResult == false { fmt.Println("error:", simpleErr) - // return } // Multivariate flag @@ -51,7 +50,6 @@ func TestIsFeatureEnabled() { fmt.Println("variantResult:", variantResult) if variantErr != nil || variantResult != "variant-value" { fmt.Println("error:", variantErr) - // return } // Multivariate + simple flag @@ -62,6 +60,5 @@ func TestIsFeatureEnabled() { fmt.Println("variantResult:", variantResult) if variantErr != nil || variantResult == true { fmt.Println("error:", variantErr) - // return } } diff --git a/examples/main.go b/examples/main.go index a115ed2..ebf06e9 100644 --- a/examples/main.go +++ b/examples/main.go @@ -1,7 +1,7 @@ package main func main() { - // TestCapture() - // TestCaptureWithSendFeatureFlagOption() + TestCapture() + TestCaptureWithSendFeatureFlagOption() TestIsFeatureEnabled() }