Created
November 6, 2022 22:37
-
-
Save mainawycliffe/6143ba641b85c9445eea7be6d15930b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var yamlExample = []byte(` | |
{"DB":"SOME_URL","PASSWORD":"pass"} | |
`) | |
viper.ReadConfig(bytes.NewBuffer(yamlExample)) | |
viper.SetConfigType("json") | |
viper.Get("DB") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment