Skip to content

Commit

Permalink
change name for getAll
Browse files Browse the repository at this point in the history
  • Loading branch information
rachelyangdog committed Jan 15, 2025
1 parent e6a6940 commit 2cfb7b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ddtrace/baggage/baggage.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ func Remove(ctx context.Context, key string) context.Context {
return withBaggage(ctx, bm)
}

// GetAll returns a **copy** of all baggage items in the context,
func GetAll(ctx context.Context) map[string]string {
// All returns a **copy** of all baggage items in the context,
func All(ctx context.Context) map[string]string {
bm, ok := baggageMap(ctx)
if !ok {
return nil
Expand Down
6 changes: 3 additions & 3 deletions ddtrace/baggage/baggage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ func TestBaggageFunctions(t *testing.T) {
}
})

t.Run("GetAll", func(t *testing.T) {
t.Run("All", func(t *testing.T) {
ctx := context.Background()

// Set multiple baggage entries
ctx = Set(ctx, "key1", "value1")
ctx = Set(ctx, "key2", "value2")

// Retrieve all baggage entries
all := GetAll(ctx)
all := All(ctx)
if len(all) != 2 {
t.Fatalf("Expected 2 items in baggage; got %d", len(all))
}
Expand Down Expand Up @@ -95,7 +95,7 @@ func TestBaggageFunctions(t *testing.T) {
ctx = Clear(ctx)

// Check that everything is gone
all := GetAll(ctx)
all := All(ctx)
if len(all) != 0 {
t.Errorf("Expected no items after clearing baggage; got %d", len(all))
}
Expand Down

0 comments on commit 2cfb7b3

Please sign in to comment.