From a451b3008e17167198da38ec627bb28d8af084de Mon Sep 17 00:00:00 2001 From: Marc Pervaz Boocha Date: Fri, 27 Feb 2026 21:18:28 +0530 Subject: Add Syslog and refactored the Sink api --- logging/http/http_test.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'logging/http') diff --git a/logging/http/http_test.go b/logging/http/http_test.go index 832b49e..e12b9b2 100644 --- a/logging/http/http_test.go +++ b/logging/http/http_test.go @@ -80,20 +80,14 @@ func TestNew(t *testing.T) { t.Fatalf("expected 1 log record, got %d", len(records)) } - record := records[0] - - attrs := map[string]slog.Value{} - record.Attrs(func(a slog.Attr) bool { - attrs[a.Key] = a.Value - return true - }) + attrs := records[0] method := attrs["method"] - if got := method.String(); got != tt.method { + if got := method.(string); got != tt.method { t.Fatalf("expected %v log record, got %v", tt.method, got) } status := attrs["status"] - if got := int(status.Int64()); got != tt.status { + if got := int(status.(int64)); got != tt.status { t.Fatalf("expected %v log record, got %v", tt.status, got) } @@ -103,11 +97,11 @@ func TestNew(t *testing.T) { } host := attrs["host"] - if got := host.String(); got != url.Host { + if got := host.(string); got != url.Host { t.Fatalf("expected %v log record, got %v", url.Host, got) } path := attrs["path"] - if got := path.String(); got != url.RequestURI() { + if got := path.(string); got != url.RequestURI() { t.Fatalf("expected %v log record, got %v", url.RequestURI(), got) } }) -- cgit v1.3.1