Skip to content

mapstructure dependency change in v1.19.0 is API breaking change (PR #1723) #1999

@aldas

Description

@aldas

Preflight Checklist

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

Viper Version

1.20.0

Go Version

1.24

Config Source

Files

Format

No response

Repl.it link

No response

Code reproducing the issue

Expected Behavior

PR #1723 changed mapstructure imports. This is a breaking change compared to v1.19.0.

I had code like that, which will not compile anymore. Import needs to be changed at my side.

import (
//...
	"github.com/mitchellh/mapstructure"
//...
)

	err := viper.Unmarshal(&appConfig, func(config *mapstructure.DecoderConfig) {
		config.TagName = "yaml"
	})

This is not documented in release notes: https://github.com/spf13/viper/blob/master/UPGRADE.md#v120x

Actual Behavior

x

Steps To Reproduce

No response

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