Skip to content

Commit

Permalink
Remove IsNil from value structs, update accessor message
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Nov 6, 2020
1 parent 89a8653 commit 66e95a7
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 22 deletions.
3 changes: 0 additions & 3 deletions cmd/pdatagen/internal/base_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ const accessorsMessagePtrTestTemplate = `func Test${structName}_${fieldName}(t *
}`

const accessorsMessageValueTemplate = `// ${fieldName} returns the ${lowerFieldName} associated with this ${structName}.
// If no ${lowerFieldName} available, it creates an empty message and associates it with this ${structName}.
//
// Empty initialized ${structName} will return "nil" ${returnType}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) ${fieldName}() ${returnType} {
Expand Down
5 changes: 0 additions & 5 deletions cmd/pdatagen/internal/base_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,6 @@ func New${structName}() ${structName} {
// Deprecated: This function will be removed soon.
func (ms ${structName}) InitEmpty() {
*ms.orig = ${originName}{}
}
// Deprecated: This function will be removed soon.
func (ms ${structName}) IsNil() bool {
return false
}`

const messageValueCopyToHeaderTemplate = `// CopyTo copies all properties from the current struct to the dest.
Expand Down
3 changes: 0 additions & 3 deletions consumer/pdata/generated_log.go

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

3 changes: 0 additions & 3 deletions consumer/pdata/generated_metrics.go

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

5 changes: 0 additions & 5 deletions consumer/pdata/generated_resource.go

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

3 changes: 0 additions & 3 deletions consumer/pdata/generated_trace.go

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

0 comments on commit 66e95a7

Please sign in to comment.