Remove the complication about internal/public for all funcs that only
need origin. Also improves significant testing.
This simplified a lot the fields (no more isCommon/isBaseCommon/etc.)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
This PR allows to add tests for CopyOrig directly in the internal
package, also enables us to move more things to internal (including
tests) for Marshal/Unmarshal.
After this PR is merged we can generate the ProtoSize and other proto
helpers in internal.
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Moving the data between same source and destination causes the
destination to be cleared.
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes#12887
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
#### Description
This PR adds support for iterators to Slice and Map types and their
autogenerated counterparts. Iterators were stabilized in Go 1.23.
The All method is analogous to [maps.All](https://pkg.go.dev/maps#All)
and [slices.All ](https://pkg.go.dev/slices#All) and is a more idiomatic
alternative to the more verbose `for i := 0; i < es.Len(); i++ { z :=
es.At(i) }` way of looping.
Code that is written like this today:
```go
for i := 0; i < ld.ResourceLogs().Len(); i++ {
rl := ld.ResourceLogs().At(i)
for j := 0; j < rl.ScopeLogs().Len(); j++ {
sl := rl.ScopeLogs().At(j)
for k := 0; k < sl.LogRecords().Len(); k++ {
lr := sl.LogRecords().At(k)
// use lr
}
}
}
```
Can now be written like this:
```go
for _, rl := range ld.ResourceLogs().All() {
for _, sl := range rl.ScopeLogs().All() {
for _, lr := range sl.LogRecords().All() {
// use lr
}
}
}
```
#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/11982
#### Description
As Testifylint is not applied on generated files, this update mdatagen
to comply with actually applied testifylint recommandations.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This generates the pdata for profiles.
<!-- Issue number if applicable -->
#### Link to tracking issue
Last step of #10109.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
The generated code is unit-tested by generated tests.
cc @mx-psi
---------
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>