Skip to content

Commit

Permalink
Generate process.args as []string in Go code (elastic#296)
Browse files Browse the repository at this point in the history
Add special handling for the process.args field to ensure that it's generated as a []string.
  • Loading branch information
andrewkroh authored Jan 7, 2019
1 parent 41bac2c commit 69de90e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion code/go/ecs/process.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions scripts/cmd/gocodegen/gocodegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ func goDataType(fieldName, elasticsearchDataType string) string {
switch {
case fieldName == "duration" && elasticsearchDataType == "long":
return "time.Duration"
case fieldName == "args" && elasticsearchDataType == "keyword":
return "[]string"
}

switch elasticsearchDataType {
Expand Down

0 comments on commit 69de90e

Please sign in to comment.