Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "gopkg.in/yaml.v2"
- "io/ioutil"
- )
- type Config struct {
- ipAddress string
- }
- func main() {
- filename := "/Users/dylan.johnson/prd-auth_svc.yaml"
- var config Config
- source, err := ioutil.ReadFile(filename)
- if err != nil {
- panic(err)
- }
- err = yaml.Unmarshal(source, &config)
- if err != nil {
- panic(err)
- }
- fmt.Printf("Value: %#v\n", config.ipAddress)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement