better to just do 

```go
defer w.Close()
```
I don't think we really care about an error that happens on Close(), and this could otherwise overwrite an error returned from Write with nil