diff --git a/client.go b/client.go index 66d820a..046e735 100644 --- a/client.go +++ b/client.go @@ -148,7 +148,7 @@ type Packet struct { Release string `json:"release,omitempty"` Tags Tags `json:"tags,omitempty"` Modules map[string]string `json:"modules,omitempty"` - Fingerprint string `json:"fingerprint,omitempty"` + Fingerprint []string `json:"fingerprint,omitempty"` Extra map[string]interface{} `json:"extra,omitempty"` Interfaces []Interface `json:"-"` diff --git a/client_test.go b/client_test.go index 383ee26..c1e28e3 100644 --- a/client_test.go +++ b/client_test.go @@ -26,14 +26,14 @@ func TestPacketJSON(t *testing.T) { Logger: "com.getsentry.raven-go.logger-test-packet-json", Tags: []Tag{Tag{"foo", "bar"}}, Modules: map[string]string{"foo": "bar"}, - Fingerprint: "a-custom-fingerprint", + Fingerprint: []string{"{{ default }}", "a-custom-fingerprint"}, Interfaces: []Interface{&Message{Message: "foo"}}, } packet.AddTags(map[string]string{"foo": "foo"}) packet.AddTags(map[string]string{"baz": "buzz"}) - expected := `{"message":"test","event_id":"2","project":"1","timestamp":"2000-01-01T00:00:00","level":"error","logger":"com.getsentry.raven-go.logger-test-packet-json","platform":"linux","culprit":"caused_by","server_name":"host1","release":"721e41770371db95eee98ca2707686226b993eda","tags":[["foo","bar"],["foo","foo"],["baz","buzz"]],"modules":{"foo":"bar"},"fingerprint":"a-custom-fingerprint","logentry":{"message":"foo"}}` + expected := `{"message":"test","event_id":"2","project":"1","timestamp":"2000-01-01T00:00:00","level":"error","logger":"com.getsentry.raven-go.logger-test-packet-json","platform":"linux","culprit":"caused_by","server_name":"host1","release":"721e41770371db95eee98ca2707686226b993eda","tags":[["foo","bar"],["foo","foo"],["baz","buzz"]],"modules":{"foo":"bar"},"fingerprint":["{{ default }}","a-custom-fingerprint"],"logentry":{"message":"foo"}}` actual := string(packet.JSON()) if actual != expected { @@ -55,11 +55,11 @@ func TestPacketJSONNilInterface(t *testing.T) { Logger: "com.getsentry.raven-go.logger-test-packet-json", Tags: []Tag{Tag{"foo", "bar"}}, Modules: map[string]string{"foo": "bar"}, - Fingerprint: "a-custom-fingerprint", + Fingerprint: []string{"{{ default }}", "a-custom-fingerprint"}, Interfaces: []Interface{&Message{Message: "foo"}, nil}, } - expected := `{"message":"test","event_id":"2","project":"1","timestamp":"2000-01-01T00:00:00","level":"error","logger":"com.getsentry.raven-go.logger-test-packet-json","platform":"linux","culprit":"caused_by","server_name":"host1","release":"721e41770371db95eee98ca2707686226b993eda","tags":[["foo","bar"]],"modules":{"foo":"bar"},"fingerprint":"a-custom-fingerprint","logentry":{"message":"foo"}}` + expected := `{"message":"test","event_id":"2","project":"1","timestamp":"2000-01-01T00:00:00","level":"error","logger":"com.getsentry.raven-go.logger-test-packet-json","platform":"linux","culprit":"caused_by","server_name":"host1","release":"721e41770371db95eee98ca2707686226b993eda","tags":[["foo","bar"]],"modules":{"foo":"bar"},"fingerprint":["{{ default }}","a-custom-fingerprint"],"logentry":{"message":"foo"}}` actual := string(packet.JSON()) if actual != expected {