Skip to content

Commit

Permalink
Use StringArrayable for BaseCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
otiai10 committed Sep 13, 2017
1 parent 792be04 commit 9abb2b4
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions 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)
}

0 comments on commit 9abb2b4

Please sign in to comment.