Skip to content

Conversation

@Plaenkler
Copy link
Owner

No description provided.

@Plaenkler Plaenkler added the enhancement New feature or request label Apr 24, 2025
@Plaenkler Plaenkler self-assigned this Apr 24, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a generic closer helper function, ErrorClose, to standardize error logging when closing io.Closers. Additionally, it refactors multiple ddns provider and configuration files to replace inline deferred close functions with calls to ErrorClose.

  • Added ErrorClose utility in pkg/logging/logging.go.
  • Replaced multiple anonymous deferred close functions throughout ddns providers and config with log.ErrorClose calls.
  • Updated files: pkg/logging/logging.go, pkg/ddns/resolver.go, pkg/ddns/providers/requests.go, pkg/ddns/providers/noip.go, pkg/ddns/providers/inwx.go, pkg/ddns/providers/infomaniak.go, pkg/config/config.go.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/logging/logging.go Added generic ErrorClose function for closing resources with error logging.
pkg/ddns/resolver.go Replaced deferred close with an immediate call to ErrorClose.
pkg/ddns/providers/requests.go Replaced deferred close with a call to ErrorClose.
pkg/ddns/providers/noip.go Replaced deferred close with a call to ErrorClose.
pkg/ddns/providers/inwx.go Replaced deferred close with a call to ErrorClose.
pkg/ddns/providers/infomaniak.go Replaced deferred close with a call to ErrorClose.
pkg/config/config.go Replaced deferred file close with a call to ErrorClose.
@Plaenkler Plaenkler merged commit 7bb58d0 into main Apr 26, 2025
16 checks passed
@Plaenkler Plaenkler deleted the generic-closer branch May 4, 2025 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

2 participants