-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update igmarkets.go #3
base: master
Are you sure you want to change the base?
Conversation
removed max=100 as it overwrites the max value when calling GetPriceHistory
Thanks for looking into that! I guess we can remove the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. Regards
@@ -537,7 +537,7 @@ func (ig *IGMarkets) GetPriceHistory(epic, resolution string, max int, from, to | |||
limitStr = fmt.Sprintf("&max=%d", max) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max is set only when "to" or "from" has no time.Time value.
GetPriceHistory requires time.Time so it will never set "max" in the "else if" to 1.
Setting max is required to not get the default of i think 10.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is: If max > 0
, we set max
twice. In page
and in limitStr
. This is wrong IMO because both are used to assemble the URL. I think we need to removed it from page
and leave limitStr
empty if max
is zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better :-) Can we please remove fmt.Println()
as it was used for debugging (I guess)?
removed max=100 as it overwrites the max value when calling GetPriceHistory