Skip to content

Commit

Permalink
[chore] Move test only code to a _test file
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu committed Feb 6, 2025
1 parent 6638b83 commit 1c82128
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions pkg/stanza/adapter/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ func ConvertEntries(entries []*entry.Entry) plog.Logs {
return pLogs
}

// convert converts one entry.Entry into plog.LogRecord allocating it.
func convert(ent *entry.Entry) plog.LogRecord {
dest := plog.NewLogRecord()
convertInto(ent, dest)
return dest
}

// convertInto converts entry.Entry into provided plog.LogRecord.
func convertInto(ent *entry.Entry, dest plog.LogRecord) {
if !ent.Timestamp.IsZero() {
Expand Down
7 changes: 7 additions & 0 deletions pkg/stanza/adapter/converter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,3 +961,10 @@ func TestGetResourceIDEmptyAndNilAreEqual(t *testing.T) {
emptyID := HashResource(map[string]any{})
require.Equal(t, nilID, emptyID)
}

// convert converts one entry.Entry into plog.LogRecord allocating it.
func convert(ent *entry.Entry) plog.LogRecord {
dest := plog.NewLogRecord()
convertInto(ent, dest)
return dest
}

0 comments on commit 1c82128

Please sign in to comment.