add tests for Writer
go fmt