Skip to content

Does viper support uppercase in yaml map? #371

@Kvaz1r

Description

@Kvaz1r

MCVE:
Yaml:

Test :
 Var1 : Hello
 Var2 : world

Code:

package main

import (
	"fmt"
	"log"

	"github.com/spf13/viper"
)

func main() {

	viper.SetConfigType("yaml")
	viper.SetConfigName("input")
	viper.AddConfigPath(".")
	if err := viper.ReadInConfig(); err != nil {
		log.Fatal(err)
	}
	fmt.Println(viper.GetStringMap("Test"))
}

Output:

map[var1:Hello var2:world]

Epected output:

map[Var1:Hello Var2:world]

That's bug or I do something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions