Fix tests that were broken and make importable with Go Modules #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix up this package so that it can be imported with Go Modules. It is imported by
stellar/go
as a fork ofg.yxqyang.asia/throttled/throttled
.Goal and scope
The tests of this package no longer build because changes were made in c99eef3 that remove the
store
sub-package and related functionality. The tests weren't updated and still reference that deleted package. This has not causedstellar/go
any problems because that repo is using Dep to manage dependencies, and Dep ignores all test files.stellar/go
is moving to Modules (stellar/go#1634) which is stricter and 💥s when a module contains Go code that is dependent on packages that don't exist.Summary of changes
deprecated_test.go
as its counterpartdeprecated.go
was removed in c99eef3.rate_test.go
TestRateLimitUpdateFailures
as it testsstore
functionality that was removed in c99eef3.rate_test.go
TestRateLimit
to use an injectedClock
since the way it receives an injected time is through an injected store, and stores were removed in c99eef3.