diff --git a/package_info.go b/package_info.go index e6c2480a494..cc62bf2b282 100644 --- a/package_info.go +++ b/package_info.go @@ -10,30 +10,36 @@ // The ffclient package provides the entry point - initialization and the basic // method to get your flags value. // -// Before using the module you need to initialized it this way: -// -// func main() { -// err := ffclient.Init(ffclient.Config{ -// PollingInterval: 3 * time.Second, -// HTTPRetriever: &httpretriever.Retriever{ -// URL: "http://example.com/flag-config.yaml", -// }, -// }) -// defer ffclient.Close() -// ... +// Before using the module you need to initialize it this way: +// +// import ( +// ffclient "github.com/thomaspoignant/go-feature-flag" +// "github.com/thomaspoignant/go-feature-flag/retriever/httpretriever" +// ... +// ) +// +// func main() { +// err := ffclient.Init(ffclient.Config{ +// PollingInterval: 3 * time.Second, +// Retriever: &httpretriever.Retriever{ +// URL: "https://code.gofeatureflag.org/blob/main/testdata/flag-config.yaml", +// }, +// }) +// defer ffclient.Close() +// ... // // This example will load a file from an HTTP endpoint and will refresh the flags every 3 seconds. // // Now you can evaluate your flags anywhere in your code. // -// func main() { -// ... -// user := ffcontext.NewEvaluationContext("user-unique-key") -// hasFlag, _ := ffclient.BoolVariation("test-flag", user, false) -// if hasFlag { -// //flag "test-flag" is true for the user -// } else { -// // flag "test-flag" is false for the user +// ... +// evaluationContext := ffcontext.NewEvaluationContext("user-unique-key") +// hasFlag, _ := ffclient.BoolVariation("test-flag", evaluationContext, false) +// if hasFlag { +// //flag "test-flag" is true for the user +// } else { +// // flag "test-flag" is false for the user +// } +// ... // } -// ... package ffclient