diff --git a/basecommands.go b/basecommands.go index 3ca03f2..0d6710e 100644 --- a/basecommands.go +++ b/basecommands.go @@ -1,26 +1,10 @@ package cwl -// BaseCommands ... +// BaseCommands represents "baseCommand" of CWL CommandLineTool. +// @see http://www.commonwl.org/v1.0/CommandLineTool.html#CommandLineTool type BaseCommands []string // New constructs "BaseCommands" struct. func (baseCommands BaseCommands) New(i interface{}) BaseCommands { - switch x := i.(type) { - - case string: - dest := []string{} - dest = append(dest, x) - return dest - case []interface{}: - dest := make([]string, len(x)) - for i, elm := range x { - str, ok := elm.(string) - if !ok { - return dest - } - dest[i] = str - } - return dest - } - return BaseCommands{} + return StringArrayable(i) }