Last active
October 23, 2015 21:50
-
-
Save xorl/f6ddee1484a52da05832 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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"path/filepath" | |
"gopkg.in/yaml.v2" | |
) | |
type Config struct { | |
Ops_params map[[]]Options | |
} | |
type Options struct { | |
environment string | |
lifecycle string | |
} | |
func main() { | |
filename, _ := filepath.Abs("/Users/rlewon/Projects/g/ops-config/hosts/vmhost99-uat.snc1.yml") | |
yamlFile, err := ioutil.ReadFile(filename) | |
if err != nil { | |
panic(err) | |
} | |
var config Config | |
err = yaml.Unmarshal(yamlFile, &config) | |
if err != nil { | |
panic(err) | |
} | |
fmt.Printf("Value: %#v\n", config.Ops_params) | |
} |
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
params: | |
env: prod | |
life: live |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment