Skip to content

Instantly share code, notes, and snippets.

@mainawycliffe
Created November 6, 2022 22:37
Show Gist options
  • Save mainawycliffe/6143ba641b85c9445eea7be6d15930b5 to your computer and use it in GitHub Desktop.
Save mainawycliffe/6143ba641b85c9445eea7be6d15930b5 to your computer and use it in GitHub Desktop.
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