|
| 1 | +# LaunchDarkly Go Test Helpers |
| 2 | + |
| 3 | +[](https://circleci.com/gh/launchdarkly/go-test-helpers) |
| 4 | + |
| 5 | +This package centralizes some test support code that is used by LaunchDarkly's Go SDK and related components, and that may be useful in other Go projects. |
| 6 | + |
| 7 | +While this code may be useful in other projects, it is primarily geared toward LaunchDarkly's own development needs and is not meant to provide a large general-purpose framework. It is meant for unit test code and should not be used as a runtime dependency. |
| 8 | + |
| 9 | +## Contents |
| 10 | + |
| 11 | +The main package provides general-purpose helper functions. |
| 12 | + |
| 13 | +Subpackage `httphelpers` provides convenience wrappers for using `net/http` and `net/http/httptest` in test code. |
| 14 | + |
| 15 | +Subpackage `ldservices` is specifically for testing LaunchDarkly SDK client components; it provides HTTP handlers that simulate the service endpoints used by the SDK. |
| 16 | + |
| 17 | +## Usage |
| 18 | + |
| 19 | +Import any of these packages in your test code: |
| 20 | + |
| 21 | +```go |
| 22 | +import ( |
| 23 | + "github.com/launchdarkly/go-test-helpers" |
| 24 | + "github.com/launchdarkly/go-test-helpers/httphelpers" |
| 25 | + "github.com/launchdarkly/go-test-helpers/ldservices" |
| 26 | +) |
| 27 | +``` |
| 28 | + |
| 29 | +Breaking changes will only be made in a new major version. It is advisable to use a dependency manager to pin these dependencies to a major version branch (`v1`, etc.). |
| 30 | + |
| 31 | +## Contributing |
| 32 | + |
| 33 | +We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this project. |
| 34 | + |
| 35 | +## About LaunchDarkly |
| 36 | + |
| 37 | +* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can: |
| 38 | + * Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases. |
| 39 | + * Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?). |
| 40 | + * Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file. |
| 41 | + * Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline. |
| 42 | +* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list. |
| 43 | +* Explore LaunchDarkly |
| 44 | + * [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information |
| 45 | + * [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides |
| 46 | + * [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation |
| 47 | + * [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates |
| 48 | + * [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies |
0 commit comments