Skip to content

Commit

Permalink
Update README.md - os.Getenv (#59)
Browse files Browse the repository at this point in the history
Fix the casing on `os.Getenv` calls.
  • Loading branch information
jlucktay committed Mar 22, 2024
1 parent 1bfd921 commit d74512f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ To get started, import the `tmdb` package and initiate the client:
```go
import "github.com/cyruzin/golang-tmdb"

tmdbClient, err := tmdb.Init(os.GetEnv("YOUR_APIKEY"))
tmdbClient, err := tmdb.Init(os.Getenv("YOUR_APIKEY"))
if err != nil {
fmt.Println(err)
}

// Using v4
tmdbClient, err := tmdb.InitV4(os.GetEnv("YOUR_BEARER_TOKEN"))
tmdbClient, err := tmdb.InitV4(os.Getenv("YOUR_BEARER_TOKEN"))
if err != nil {
fmt.Println(err)
}
Expand All @@ -52,7 +52,7 @@ customClient := http.Client{
Transport: &http.Transport{
MaxIdleConns: 10,
IdleConnTimeout: 15 * time.Second,
}
},
}

tmdbClient.SetClientConfig(customClient)
Expand All @@ -62,7 +62,7 @@ tmdbClient.SetClientConfig(customClient)
//
// You can read more about how this works:
// https://developers.themoviedb.org/3/authentication/how-do-i-generate-a-session-id
tmdbClient.SetSessionID(os.GetEnv("YOUR_SESSION_ID"))
tmdbClient.SetSessionID(os.Getenv("YOUR_SESSION_ID"))

movie, err := tmdbClient.GetMovieDetails(297802, nil)
if err != nil {
Expand All @@ -77,13 +77,13 @@ With optional params:
```go
import "github.com/cyruzin/golang-tmdb"

tmdbClient, err := tmdb.Init(os.GetEnv("YOUR_APIKEY"))
tmdbClient, err := tmdb.Init(os.Getenv("YOUR_APIKEY"))
if err != nil {
fmt.Println(err)
}

// Using v4
tmdbClient, err := tmdb.InitV4(os.GetEnv("YOUR_BEARER_TOKEN"))
tmdbClient, err := tmdb.InitV4(os.Getenv("YOUR_BEARER_TOKEN"))
if err != nil {
fmt.Println(err)
}
Expand All @@ -108,7 +108,7 @@ Generate image and video URLs:
```go
import "github.com/cyruzin/golang-tmdb"

tmdbClient, err := tmdb.Init(os.GetEnv("YOUR_APIKEY"))
tmdbClient, err := tmdb.Init(os.Getenv("YOUR_APIKEY"))
if err != nil {
fmt.Println(err)
}
Expand Down

0 comments on commit d74512f

Please sign in to comment.