From 2c541c4ccc8cdcfdb430519f9bf9095f1b8723f8 Mon Sep 17 00:00:00 2001 From: xcaspar Date: Thu, 18 Feb 2021 19:50:39 +0800 Subject: [PATCH] feature: add SetCategories func in action model Signed-off-by: xcaspar --- spec/model.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/model.go b/spec/model.go index 2bc54c5..86cce41 100644 --- a/spec/model.go +++ b/spec/model.go @@ -85,6 +85,9 @@ type ExpActionCommandSpec interface { // Scenario categories Categories() []string + + // SetCategories + SetCategories(categories []string) } type ExpFlagSpec interface { @@ -208,6 +211,10 @@ func (b *BaseExpActionCommandSpec) Categories() []string { return b.ActionCategories } +func (b *BaseExpActionCommandSpec) SetCategories(categories []string) { + b.ActionCategories = categories +} + // ActionModel for yaml file type ActionModel struct { ActionName string `yaml:"action"` @@ -282,6 +289,10 @@ func (am *ActionModel) Categories() []string { return am.ActionCategories } +func (am *ActionModel) SetCategories(categories []string) { + am.ActionCategories = categories +} + type ExpPrepareModel struct { PrepareType string `yaml:"type"` PrepareFlags []ExpFlag `yaml:"flags"`