Skip to content

refactor(go-forwarder): Tags struct to marshall properly#1105

Merged
ndakkoune merged 4 commits intonabil.dakkoune/go-forwarderfrom
nabil.dakkoune/refactor-tags-marshalling
Apr 13, 2026
Merged

refactor(go-forwarder): Tags struct to marshall properly#1105
ndakkoune merged 4 commits intonabil.dakkoune/go-forwarderfrom
nabil.dakkoune/refactor-tags-marshalling

Conversation

@ndakkoune
Copy link
Copy Markdown
Contributor

What does this PR do?

Refactors / Adds the Tags struct to force the unmarshall to create a comma-separated string of key:value pairs, due to backend constraint.

Motivation

Testing Guidelines

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
  • This PR passes the unit tests
  • This PR passes the installation tests (ask a Datadog member to run the tests)

@github-actions github-actions bot added the aws label Apr 10, 2026
@ndakkoune ndakkoune changed the title Nabil.dakkoune/refactor tags marshalling refactor(go-forwarder): Tags struct to marshall properly Apr 10, 2026
@ndakkoune ndakkoune marked this pull request as ready for review April 10, 2026 15:47
@ndakkoune ndakkoune requested a review from a team as a code owner April 10, 2026 15:47
@ViBiOh ViBiOh self-assigned this Apr 13, 2026
Comment on lines +41 to +47
got, err := json.Marshal(tc.tags)
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
if string(got) != tc.want {
t.Errorf("got %s, want %s", got, tc.want)
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 suggestion: ‏You can test the marshal/unmarshal cycle by doing both during the test.

If you marshal, then unmarshal, you should have an equal slice in the output.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

@ndakkoune ndakkoune merged commit 2213b73 into nabil.dakkoune/go-forwarder Apr 13, 2026
10 checks passed
@ndakkoune ndakkoune deleted the nabil.dakkoune/refactor-tags-marshalling branch April 13, 2026 08:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants