Thank you for using ff4go! Feel free to report any issue or improvement 🙏
https://pkg.go.dev/github.com/dorianneto/ff4go#section-documentation
First, you need to install the dependency
go get github.com/dorianneto/ff4go
Once the dependency is installed, you can use it like this:
package main
import (
"fmt"
"github.com/dorianneto/ff4go"
)
func main() {
m, err := ff4go.NewManager([]byte(`{"flags":[{"name":"new-ui","enabled":true,"rules":{"users":["user1"],"environments":["development"]}}]}`))
if err != nil {
panic(err)
}
fmt.Println(m.IsEnabled("new-ui")) // true
fmt.Println(m.IsEnabledForUser("new-ui", "user1")) // true
fmt.Println(m.IsEnabledForEnvironment("new-ui", "staging")) // false
}
Language | SDK |
---|---|
Go | ff4go |
Typescript | coming soon |