Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #71 from aheuermann/fingerprint_array
Browse files Browse the repository at this point in the history
Adding support for an array of fingerprints
  • Loading branch information
mattrobenolt committed Jan 13, 2016
2 parents f7bd361 + 37ce9eb commit 1cc47a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:"-"`
Expand Down
8 changes: 4 additions & 4 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit 1cc47a9

Please sign in to comment.