Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "gopkg.in/yaml.v2"
  6. "io/ioutil"
  7. )
  8.  
  9. type Config struct {
  10. ipAddress string
  11. }
  12.  
  13. func main() {
  14. filename := "/Users/dylan.johnson/prd-auth_svc.yaml"
  15. var config Config
  16. source, err := ioutil.ReadFile(filename)
  17. if err != nil {
  18. panic(err)
  19. }
  20. err = yaml.Unmarshal(source, &config)
  21. if err != nil {
  22. panic(err)
  23. }
  24. fmt.Printf("Value: %#v\n", config.ipAddress)
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement