Finnhub-Stock-API / finnhub-go

Finnhub Go API client. Finnhub API provides institutional-grade financial data to investors, fintech startups and investment firms. We support real-time stock price, global fundamentals and alternative data. https://finnhub.io/docs/api
https://finnhub.io/
Apache License 2.0
62 stars 6 forks source link

Client initialization & auth error from parsing context #6

Open youngjk opened 3 years ago

youngjk commented 3 years ago

Was trying to initialize the client and kept getting error around date parsing.

  finnhubClient := finnhub.NewAPIClient(finnhub.NewConfiguration()).DefaultApi
    auth := context.WithValue(context.Background(), finnhub.ContextAPIKey, finnhub.APIKey{
        Key: FINNHUB_TOKEN,
  })

Error message

2021/01/10 22:30:54 parsing time ""2020-03-13 00:00:00"" as ""2006-01-02T15:04:05Z07:00"": cannot parse " 00:00:00"" as "T"
youngjk commented 3 years ago

Wanted to follow up @finnhubio

nongdenchet commented 3 years ago

Hi @youngjk sorry for late reply. I am having a look now

nongdenchet commented 3 years ago

Hi @youngjk did you face the issue when calling an api? Asking because I am able to initialize the library just fine. Can you post your full error logs? Can you also provide what Go version and what library version you are using? Are you on the latest version 1.2.1? If possible can you post the whole code?