Skip to content

Commit f72d762

Browse files
authored
fix: [Go] fixed Google AI API key from env var logic (#475)
1 parent 6e38446 commit f72d762

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/plugins/googleai/googleai.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func Init(ctx context.Context, apiKey string) (err error) {
7272
}()
7373

7474
if apiKey == "" {
75-
apiKey := os.Getenv("GOOGLE_GENAI_API_KEY")
75+
apiKey = os.Getenv("GOOGLE_GENAI_API_KEY")
7676
if apiKey == "" {
7777
return fmt.Errorf("googleai.Init: Google AI requires setting GOOGLE_GENAI_API_KEY in the environment. You can get an API key at https://ai.google.dev")
7878
}

0 commit comments

Comments
 (0)