Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var runContent= []byte(`
- - runners:
- - name: function1
- type: func1
- - command: spawn child process
- - command: build
- - command: gulp
- - name: function1
- type: func2
- - command: run function 1
- - name: function3
- type: func3
- - command: ruby build
- - name: function4
- type: func4
- - command: go build
- `)
- type Runners struct {
- runners string `yaml:"runners"`
- name string `yaml:”name”`
- Type: string `yaml: ”type”`
- command [] Command
- }
- type Command struct {
- command string `yaml: ”command”`
- }
- runners := Runners{}
- // parse mta yaml
- err = yaml.Unmarshal(runContent, &runners)
- if err != nil {
- log.Fatalf("Error : %v", err)
- }
Add Comment
Please, Sign In to add comment