Skip to content

Commit

Permalink
Remove warning about IsNil, this function no-longer exists (#2518)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu authored Feb 22, 2021
1 parent f46ee92 commit 92f1cac
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 364 deletions.
14 changes: 0 additions & 14 deletions cmd/pdatagen/internal/base_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (
)

const accessorSliceTemplate = `// ${fieldName} returns the ${originFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) ${fieldName}() ${returnType} {
return new${returnType}(&(*ms.orig).${originFieldName})
}`
Expand All @@ -35,8 +33,6 @@ const accessorsSliceTestTemplate = `func Test${structName}_${fieldName}(t *testi
}`

const accessorsMessageValueTemplate = `// ${fieldName} returns the ${lowerFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) ${fieldName}() ${returnType} {
return new${returnType}(&(*ms.orig).${originFieldName})
}`
Expand All @@ -48,15 +44,11 @@ const accessorsMessageValueTestTemplate = `func Test${structName}_${fieldName}(t
}`

const accessorsPrimitiveTemplate = `// ${fieldName} returns the ${lowerFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) ${fieldName}() ${returnType} {
return (*ms.orig).${originFieldName}
}
// Set${fieldName} replaces the ${lowerFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) Set${fieldName}(v ${returnType}) {
(*ms.orig).${originFieldName} = v
}`
Expand All @@ -70,22 +62,16 @@ const accessorsPrimitiveTestTemplate = `func Test${structName}_${fieldName}(t *t
}`

const accessorsPrimitiveTypedTemplate = `// ${fieldName} returns the ${lowerFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) ${fieldName}() ${returnType} {
return ${returnType}((*ms.orig).${originFieldName})
}
// Set${fieldName} replaces the ${lowerFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) Set${fieldName}(v ${returnType}) {
(*ms.orig).${originFieldName} = ${rawType}(v)
}`

const accessorsPrimitiveWithoutSetterTypedTemplate = `// ${fieldName} returns the ${lowerFieldName} associated with this ${structName}.
//
// Important: This causes a runtime error if IsNil() returns "true".
func (ms ${structName}) ${fieldName}() ${returnType} {
return ${returnType}((*ms.orig).${originFieldName})
}`
Expand Down
8 changes: 0 additions & 8 deletions consumer/pdata/generated_common.go

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

44 changes: 0 additions & 44 deletions consumer/pdata/generated_log.go

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

Loading

0 comments on commit 92f1cac

Please sign in to comment.