Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve message for New funcs in pdata #4402

Merged
merged 1 commit into from
Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions model/internal/cmd/pdatagen/internal/base_structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,14 @@ func new${structName}(orig *${originName}) ${structName} {

// New${structName} creates a new empty ${structName}.
//
// This must be used only in testing code since no "Set" method available.
// This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice,
// OR directly access the member if this is embedded in another struct.
func New${structName}() ${structName} {
return new${structName}(&${originName}{})
}

// MoveTo moves all properties from the current struct to dest
// reseting the current instance to its zero value
// resetting the current instance to its zero value
func (ms ${structName}) MoveTo(dest ${structName}) {
*dest.orig = *ms.orig
*ms.orig = ${originName}{}
Expand Down
5 changes: 3 additions & 2 deletions model/pdata/generated_common.go

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

15 changes: 9 additions & 6 deletions model/pdata/generated_log.go

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

75 changes: 45 additions & 30 deletions model/pdata/generated_metrics.go

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

5 changes: 3 additions & 2 deletions model/pdata/generated_resource.go

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

Loading