Skip to content
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

Refactor Genesis type in Config to time.Time #312

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Jun 26, 2023

Changed Genesis type from string to type Genesis time.Time, which implements flags.Unmarshaler interface from go-flags for automatic parsing. Therefore, manual parsing in code is not required anymore.

@poszu poszu requested a review from fasmat June 26, 2023 21:42
@poszu poszu force-pushed the fix-genesis-time-type-in-config branch from c8c6b9c to 86e60c0 Compare June 26, 2023 21:44
@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Merging #312 (86e60c0) into develop (c5b0d7c) will increase coverage by 0.0%.
The diff coverage is 76.9%.

@@           Coverage Diff           @@
##           develop    #312   +/-   ##
=======================================
  Coverage     72.6%   72.7%           
=======================================
  Files           17      17           
  Lines         1499    1503    +4     
=======================================
+ Hits          1089    1093    +4     
  Misses         301     301           
  Partials       109     109           
Impacted Files Coverage Δ
service/service.go 76.9% <75.0%> (+0.2%) ⬆️
config/config.go 71.8% <100.0%> (ø)

Copy link
Member

@fasmat fasmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time.Time should really be a supported type by the package we are using for parsing; time.Duration is already.

Unfortunately it seems like go-flags hasn't been updated in 5 years, so it is unlikely that this will be added in the near future.

@poszu
Copy link
Contributor Author

poszu commented Jun 27, 2023

time.Time should really be a supported type by the package we are using for parsing; time.Duration is already.

Unfortunately it seems like go-flags hasn't been updated in 5 years, so it is unlikely that this will be added in the near future.

Then the author would have to pick specific time format (or make it somehow configurable).

@poszu poszu added this pull request to the merge queue Jun 27, 2023
Merged via the queue into develop with commit 58a3564 Jun 27, 2023
@fasmat fasmat deleted the fix-genesis-time-type-in-config branch June 27, 2023 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants