-
Notifications
You must be signed in to change notification settings - Fork 749
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
Remove time.Now() as the first parameter of NewRates() #1953
Conversation
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 good; just a nitpick.
@@ -143,7 +143,6 @@ func TestReadWriteRates(t *testing.T) { | |||
} else { | |||
rates := currencyConverter.Rates().(*Rates) | |||
assert.Equal(t, tt.wantConversions, (*rates).Conversions, tt.description) | |||
assert.Equal(t, tt.wantDataAsOf, (*rates).DataAsOf, tt.description) |
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.
You should also be able to delete wantDataAsOf
in the tests
struct in this test TestReadWriteRates
.
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.
You're totally right. Removed
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.
LGTM
… prebid-master * 'master' of https://github.com/prebid/prebid-server: Update Viper (prebid#1969) /cookie_sync Endpoint Rewrite (prebid#1879) New Adapter: IQZone (prebid#1964) Remove old race conidtion tests (prebid#1958) Remove time.Now() as the first parameter of NewRates() (prebid#1953) # Conflicts: # config/config.go # usersync/usersyncers/syncer_test.go
The
DataAsOf time.Time
field of theRates struct
found incurrency/rates.go
has no use in practice because(rc *RateConverter) update()
method sets theRateConverter
'slastUpdated
field totime.Now()
in line 82 shown below and ignores therates.DataAsOf
field that thefetch()
function unmarshals in line 79. This pull request removes theDataAsOf
field entirely which is useful in order to simplify the code specially in the numerousNewRates()
calls throughout the codebase.