Go viper .yaml values environment variables override
问题 I'm trying to have application.yaml file in go application which contains ${RMQ_HOST} values which I want to override with environment variables. In application.yaml I've got: rmq: test: host: ${RMQ_HOST} port: ${RMQ_PORT} And in my loader I have: log.Println("Loading config...") viper.SetConfigName("application") viper.SetConfigType("yaml") viper.AddConfigPath(".") viper.AutomaticEnv() err := viper.ReadInConfig() The problem I have is ${RMQ_HOST} won't get replaced by the values I've set in