openfga / go-sdk

OpenFGA SDK for Go
https://openfga.dev
Apache License 2.0
59 stars 24 forks source link

Credentials usage example in readme wrong #7

Closed DGuhr closed 1 year ago

DGuhr commented 1 year ago

Using the credentials example from the readme results in a "missing type in composite literal" error.

reproducer: https://go.dev/play/p/0wt9cNVIheg

fix: define it like this

...
Config: &credentials.Config{
     ApiToken: os.Getenv("OPENFGA_API_TOKEN"), // will be passed as the "Authorization: Bearer ${ApiToken}" request header
},

see https://go.dev/play/p/n45oa0Rd4fZ

DGuhr commented 1 year ago

ok for whatever reasons you don't accept PRs, so feel free to change it yourself.