示例#1
0
文件: parser.go 项目: hotchemi/walter
func (parser *Parser) initStage(stageMap map[interface{}]interface{}) (stages.Stage, error) {
	var stageType = "command"
	if stageMap["type"] != nil {
		stageType = stageMap["type"].(string)
	} else if stageMap["stage_type"] != nil {
		log.Warn("found property \"stage_type\"")
		log.Warn("property \"stage_type\" is deprecated. please use \"type\" instead.")
		stageType = stageMap["stage_type"].(string)
	}
	return stages.InitStage(stageType)
}
示例#2
0
func createStage(stageType string) stages.Stage {
	stage, _ := stages.InitStage(stageType)
	return stage
}