lint tests

This commit is contained in:
Adrien Marquès 2018-11-13 21:36:19 +01:00
parent a9a69a5728
commit 87bf394536
2 changed files with 8 additions and 8 deletions

View File

@ -201,12 +201,12 @@ func TestReceiverAndSyntaxErrors(t *testing.T) {
} }
} }
var readerError = errors.New("error") var errReader = errors.New("error")
type defectiveReader struct{} type defectiveReader struct{}
func (d defectiveReader) Read(buf []byte) (int, error) { func (d defectiveReader) Read(buf []byte) (int, error) {
return 0, readerError return 0, errReader
} }
func TestReadErrors(t *testing.T) { func TestReadErrors(t *testing.T) {
@ -221,8 +221,8 @@ func TestReadErrors(t *testing.T) {
t.Fatalf("expected error") t.Fatalf("expected error")
} }
if err.Error() != (&LineError{0, readerError}).Error() { if err.Error() != (&LineError{0, errReader}).Error() {
t.Fatalf("expected error <%s>, got <%s>", &LineError{0, readerError}, err) t.Fatalf("expected error <%s>, got <%s>", &LineError{0, errReader}, err)
} }
} }

View File

@ -167,12 +167,12 @@ func TestDefaultIndent(t *testing.T) {
} }
} }
var writerError = errors.New("error") var errWriter = errors.New("error")
type defectiveWriter struct{} type defectiveWriter struct{}
func (d defectiveWriter) Write(buf []byte) (int, error) { func (d defectiveWriter) Write(buf []byte) (int, error) {
return 0, writerError return 0, errWriter
} }
func TestWriteError(t *testing.T) { func TestWriteError(t *testing.T) {
@ -191,8 +191,8 @@ func TestWriteError(t *testing.T) {
// encode back to writer // encode back to writer
encoder := NewEncoder(w) encoder := NewEncoder(w)
if err := encoder.Encode(receiver); err != writerError { if err := encoder.Encode(receiver); err != errWriter {
t.Fatalf("expected error <%s>, got <%s>", writerError, err) t.Fatalf("expected error <%s>, got <%s>", errWriter, err)
} }
} }