-
Notifications
You must be signed in to change notification settings - Fork 560
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I think this should be:
Or equivalent that doesn't use filepath package, if importing it inside time package is too costly.
That might be the case. Go 1.5 standard time package doesn't import filepath (although it imports syscall, runtime, etc.), it just implements
loadLocation
differently on each platform (windows, unix, ios, etc.).But if this is only needed for tests, then I think importing filepath (for tests only) is completely justified, since performance for tests is not as important as normal code.
If it really makes sense not to use proper filepath manipulation here, then at the very least there should be a comment explaining why incorrect behavior is being used. Otherwise this code screams "this is wrong, this is a bug" for me when I read it.