cupcake/raven-go — pull request #19 by tylrtrmbl (2014-01-05 06:04:28+00:00)
Title: Another way to try to be on spec!

Remember cupcake/raven-go#14? It was all about trying to pass additional info into the `Capture*` methods. Unfortunately, the way I chose to do it (variadics pulled apart by type switches) wasn't type safe, which isn't great.

However, there is an obvious way to make type safety work: instead of variadics, just introduce the ability to merge packets.

##### Current `master`

```go
func (client *Client) CaptureMessage(message string, tags map[string]string, interfaces ...Interface) string
```

Only allows tags and interfaces :frowning:

##### Bad Variadic Solution

```go
func (client *Client) CaptureMessage(message string, attr ...interface{}) string
```

Not type safe like at all :weary:

##### This Pull Request

```go
func (client *Client) CaptureMessage(message string, packetToMerge *Packet) string
```

The actual signature is a little more descriptive, but this does everything both of us want (I think)! :relaxed:

##### What's Next

Before I get going on:

- Fixing the tests
- Writing new tests
- Adding the in-code documentation

I want to know what you think of this direction! Like last time, the change isn't as big as it looks. Mainly, `Capture*` methods now take what used to be a `Packet` in and merging happens now. `Client` also dispenses the packets like last time. `writer.go` nicely demos how this looks:

```go
w.Client.CaptureMessage(string(p), &EventInfo{Level: w.Level, Logger: w.Logger})
```

I ended up renaming some things to make more sense to me, and factoring things into different files while trying to make sense of the world :wink: but I I did like the changes in the end.

Thanks for looking this over again! Let me know if you have any questions.