// parsePlans creates the struct representation of the plans section in the yaml file.
parsePlans creates the struct representation of the plans section in the yaml file.
// parsePlans creates the struct representation of the plans section in the yaml file .
func parsePlans(plansYaml []interface{}, variables map[string]string) (plans map[string]model.Plan, err error) {
	plans = make(map[string]model.Plan)
	for _, planYaml := range plansYaml {
		var plan model.Plan
		planYaml := planYaml.(map[string]interface{})
		plan.Name = planYaml["Name"].(string)
		if description, ok := planYaml["Description"].(string); ok {
			plan.Description = description
		}
		plan.Tasks, err = parseTasks(planYaml["Tasks"].([]interface{}), variables)
		if err != nil {
			return plans, err
		}
		plans[plan.Name] = plan
	}
	return plans, nil
}
func parsePlans ( plansYaml [ ] interface { } , variables map [ string ] string ) ( plans map [ string ] model . Plan , err error ) { plans = make ( map [ string ] model . Plan ) for _ , planYaml := range plansYaml { var plan model . Plan planYaml := planYaml . ( map [ string ] interface { } ) plan . Name = planYaml [ " " ] . ( string ) if description , ok := planYaml [ " " ] . ( string ) ; ok { plan . Description = description } plan . Tasks , err = parseTasks ( planYaml [ " " ] . ( [ ] interface { } ) , variables ) if err != nil { return plans , err } plans [ plan . Name ] = plan } return plans , nil }
parsePlans creates the struct representation of the plans section in the yaml file.
parsePlans creates the struct representation of the plans section in the yaml file .
// Iterate plans // Parse the tasks belonging to this plan