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

Remove all golangci-error #5

Merged
merged 14 commits into from
Sep 13, 2023
Merged

Conversation

Monirzadeh
Copy link

this Pull request try to fix error of golangci in code to be update to golang 1.20

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6150601568

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 37 unchanged lines in 2 files lost coverage.
  • Overall coverage remained the same at 87.105%

Files with Coverage Reduction New Missed Lines %
fetchmedia.go 3 93.28%
epub.go 34 85.34%
Totals Coverage Status
Change from base Build 6135742601: 0.0%
Covered Lines: 1074
Relevant Lines: 1233

💛 - Coveralls

@Monirzadeh Monirzadeh force-pushed the fix-golangci-error branch 2 times, most recently from eec96b0 to 7a58352 Compare September 11, 2023 19:59
@Monirzadeh
Copy link
Author

Hi @bmaupin do you know why we have this line in project but not use that?
https://github.com/go-shiori/go-epub/blob/dc41032709c02171defc7dfa8bce83ce75ca0c79/toc.go#L237C1-L239C2

@Monirzadeh Monirzadeh marked this pull request as ready for review September 11, 2023 21:03
@Monirzadeh
Copy link
Author

Monirzadeh commented Sep 11, 2023

Hi @fmartingr.
i try to not change code so much and follow same error handling in each individual function. but if you think we should change them to better option please leave comment on them.
for example i use fatal one or two function do you think we should replace them?

@fmartingr
Copy link
Member

Hi @fmartingr.
i try to not change code so much and follow same error handling in each individual function. but if you think we should change them to better option please leave comment on them.
for example i use fatal one or two function do you think we should replace them?

I think those t.Fatal are ok, since they are failing in system calls (like copy, create temp, etc.). If that calls fails there's a high change that something is wrong at another level anyway. If we put t.Error in io.Copy for example, there's a chance that all calls to that are going to fail because of the same reason, so it's better to fail early I think.

Copy link
Member

@fmartingr fmartingr left a comment

Choose a reason for hiding this comment

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

Looking awesome, clean slate for the linter :)

I see how in the future we could allow creating a new Epub instance providing a custom logger from log/slog, but we can plan that later on.

Awesome work

@fmartingr fmartingr merged commit 87c4e0c into go-shiori:main Sep 13, 2023
4 checks passed
@Monirzadeh
Copy link
Author

Thanks.
i just don't know why we have this in code but i don't remove that. #5 (comment)

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.

None yet

3 participants