Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

fix: config type check when loading any config#2007

Merged
sagikazarmark merged 1 commit intomasterfrom
fix-config-type
Mar 26, 2025
Merged

fix: config type check when loading any config#2007
sagikazarmark merged 1 commit intomasterfrom
fix-config-type

Conversation

@sagikazarmark
Copy link
Collaborator

No description provided.

@sagikazarmark sagikazarmark requested a review from Copilot March 26, 2025 17:23
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 fixes the config type check when loading configuration data by streamlining error handling and avoiding redundant configuration map creation.

  • Updated ReadConfig and MergeConfig functions to load configuration into a local map and then apply it.
  • Reorganized unmarshalReader to compute the config type prior to reading the input stream.
Comments suppressed due to low confidence (1)

viper.go:1673

  • The call to buf.ReadFrom(in) does not check for errors, which may mask I/O issues during configuration loading. Consider capturing and handling the returned error from ReadFrom to ensure robust error handling.
buf.ReadFrom(in)

@sagikazarmark sagikazarmark added the kind/bug Something isn't working label Mar 26, 2025
@sagikazarmark sagikazarmark merged commit 1508a7b into master Mar 26, 2025
45 of 46 checks passed
@sagikazarmark sagikazarmark deleted the fix-config-type branch March 26, 2025 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant