Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
neilkakkar committed Mar 15, 2024
1 parent 3e76300 commit 8470f8e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
3 changes: 2 additions & 1 deletion examples/capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package main

import (
"fmt"
"github.com/posthog/posthog-go"
"time"

"github.com/posthog/posthog-go"
)

func TestCapture() {
Expand Down
17 changes: 7 additions & 10 deletions examples/featureflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -28,7 +29,6 @@ func TestIsFeatureEnabled() {

if boolErr != nil || boolResult == nil {
fmt.Println("error:", boolErr)
// return
}

// Simple flag
Expand All @@ -40,7 +40,6 @@ func TestIsFeatureEnabled() {
fmt.Println("simpleResult:", simpleResult)
if simpleErr != nil || simpleResult == false {
fmt.Println("error:", simpleErr)
// return
}

// Multivariate flag
Expand All @@ -51,7 +50,6 @@ func TestIsFeatureEnabled() {
fmt.Println("variantResult:", variantResult)
if variantErr != nil || variantResult != "variant-value" {
fmt.Println("error:", variantErr)
// return
}

// Multivariate + simple flag
Expand All @@ -62,6 +60,5 @@ func TestIsFeatureEnabled() {
fmt.Println("variantResult:", variantResult)
if variantErr != nil || variantResult == true {
fmt.Println("error:", variantErr)
// return
}
}
4 changes: 2 additions & 2 deletions examples/main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

func main() {
// TestCapture()
// TestCaptureWithSendFeatureFlagOption()
TestCapture()
TestCaptureWithSendFeatureFlagOption()
TestIsFeatureEnabled()
}

0 comments on commit 8470f8e

Please sign in to comment.