Skip to content

Maintenance/upgrade go and fix linter issues#162

Merged
orgrim merged 8 commits intoorgrim:masterfrom
l00ptr:maintenance/upgrade-go-and-fix-linter-issues
Apr 21, 2026
Merged

Maintenance/upgrade go and fix linter issues#162
orgrim merged 8 commits intoorgrim:masterfrom
l00ptr:maintenance/upgrade-go-and-fix-linter-issues

Conversation

@l00ptr
Copy link
Copy Markdown
Collaborator

@l00ptr l00ptr commented Apr 20, 2026

The first commit is for upgrading Go to the latest version; the others are initial work to introduce golangci-lint and golines. If needed, I can split this MR into two separate ones.

l00ptr added 8 commits April 20, 2026 14:44
Unfortunately multiple IPv6 hosts no longer with net/url Parse() func,
so may be we should implement our own connection URI parser.
io/ioutil is deprecated since golang 1.16
and fix issue on the test case for b2 implementation.
- Remove useless usage of fmt.Sprintf()
- Fix ineffassign
- Use implicit bool type
- Remove useless break
- Remove useless blank assignation
- Fix errors formatting (punctuation, newline,...)
- Use ReplaceAll instead of Replace (with -1)
- Use case instead of long if, else if, else
Introduce a WrappedClose() helper to properly propagate Close() errors
when using defer, avoiding silent error loss during cleanup.

Refactor to:

- Use named return errors to allow deferred error propagation
- Replace direct defer Close() calls with WrappedClose
- Ensure Close() errors are not ignored (notably for writers like age)
- Return accumulated errors instead of discarding them

Also:

- Fix unchecked fmt.Fprintf errors
- Make cleanup paths more explicit when removing files after failure
- Improve test by checking errors in deferred cleanup
@l00ptr l00ptr requested a review from orgrim April 20, 2026 12:50
@orgrim orgrim merged commit f94626d into orgrim:master Apr 21, 2026
9 checks passed
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