Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MergeInConfig does not use extension as config type #1994

Closed
Labels
kind/bugSomething isn't working
@graffic

Description

@graffic

Preflight Checklist

  • I have searched theissue tracker for an issue that matches the one I want to file, without success.
  • I am not looking for support or already pursued the availablesupport channels without success.
  • I have checked thetroubleshooting guide for my problem, without success.

Viper Version

1.20.0

Go Version

1.23

Config Source

Files

Format

YAML

Repl.it link

https://replit.com/@graffic/MergeInConfig-error

Code reproducing the issue

package mainimport ("github.com/spf13/viper")funcmain() {v:=viper.New()v.SetConfigFile("config.yaml")err:=v.MergeInConfig()iferr!=nil {panic(err)}}

Expected Behavior

I would expect that the configuration type detected inMergeInConfig be given to MergeConfig or at least set so the call works.

Actual Behavior

MergeInConfig already validates the configuration file extension, but a further call toMergeConfig inside that method, checks for an already set configuration type and the call fails since there is none set.

Steps To Reproduce

See repl.it link

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp