Skip to content

fix: config type check when loading any config - #2007

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

sagikazarmark merged 1 commit into
masterfrom
fix-config-type

Conversation

@sagikazarmark

Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Mark Sagi-Kazar <mark.sagikazar@gmail.com>
@sagikazarmark
sagikazarmark requested a review from Copilot March 26, 2025 17:23

Copilot AI left a comment

Copy link
Copy Markdown

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)

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.

2 participants