-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from kabukky/development
Added: Arguments for plugin helpers.
- Loading branch information
Showing
7 changed files
with
80 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package methods | ||
|
||
import ( | ||
"github.com/kabukky/journey/structure" | ||
"strings" | ||
) | ||
|
||
func ProcessHelperArguments(arguments []structure.Helper) map[string]string { | ||
argumentsMap := make(map[string]string) | ||
for index, _ := range arguments { | ||
// Separate = arguments and put them in map | ||
argumentParts := strings.SplitN(arguments[index].Name, "=", 2) | ||
if len(argumentParts) > 1 { | ||
argumentsMap[argumentParts[0]] = argumentParts[1] | ||
} else { | ||
argumentsMap[arguments[index].Name] = "" | ||
} | ||
} | ||
return argumentsMap | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters