spf13 / viper

Go configuration with fangs
MIT License
26.32k stars 2.01k forks source link

'' expected a map, got 'ptr' #1709

Closed Yancy0220 closed 6 months ago

Yancy0220 commented 7 months ago

Preflight Checklist

Viper Version

1.8.1

Go Version

1.21.5

Config Source

Manual set

Format

TOML

Repl.it link

No response

Code reproducing the issue

if err = v.Unmarshal(&c); err != nil {
        return nil, err
    }
    return c, nil

Expected Behavior

报错: '' expected a map, got 'ptr'

Actual Behavior

报错: '' expected a map, got 'ptr'

Steps To Reproduce

No response

Additional Information

No response

github-actions[bot] commented 7 months ago

👋 Thanks for reporting!

A maintainer will take a look at your issue shortly. 👀

In the meantime: We are working on Viper v2 and we would love to hear your thoughts about what you like or don't like about Viper, so we can improve or fix those issues.

⏰ If you have a couple minutes, please take some time and share your thoughts: https://forms.gle/R6faU74qPRPAzchZ9

📣 If you've already given us your feedback, you can still help by spreading the news, either by sharing the above link or telling people about this on Twitter:

https://twitter.com/sagikazarmark/status/1306904078967074816

Thank you! ❤️

juliusbachnick commented 7 months ago

I'm relatively sure that this is a duplicate of #1706

sagikazarmark commented 6 months ago

It is. Please follow that issue.