diff --git a/internal/cnf/parser/nginx/decoder_test.go b/internal/cnf/parser/nginx/decoder_test.go index b4d40fa..e108071 100644 --- a/internal/cnf/parser/nginx/decoder_test.go +++ b/internal/cnf/parser/nginx/decoder_test.go @@ -201,12 +201,12 @@ func TestReceiverAndSyntaxErrors(t *testing.T) { } } -var readerError = errors.New("error") +var errReader = errors.New("error") type defectiveReader struct{} func (d defectiveReader) Read(buf []byte) (int, error) { - return 0, readerError + return 0, errReader } func TestReadErrors(t *testing.T) { @@ -221,8 +221,8 @@ func TestReadErrors(t *testing.T) { t.Fatalf("expected error") } - if err.Error() != (&LineError{0, readerError}).Error() { - t.Fatalf("expected error <%s>, got <%s>", &LineError{0, readerError}, err) + if err.Error() != (&LineError{0, errReader}).Error() { + t.Fatalf("expected error <%s>, got <%s>", &LineError{0, errReader}, err) } } diff --git a/internal/cnf/parser/nginx/encoder_test.go b/internal/cnf/parser/nginx/encoder_test.go index c900827..2f50170 100644 --- a/internal/cnf/parser/nginx/encoder_test.go +++ b/internal/cnf/parser/nginx/encoder_test.go @@ -167,12 +167,12 @@ func TestDefaultIndent(t *testing.T) { } } -var writerError = errors.New("error") +var errWriter = errors.New("error") type defectiveWriter struct{} func (d defectiveWriter) Write(buf []byte) (int, error) { - return 0, writerError + return 0, errWriter } func TestWriteError(t *testing.T) { @@ -191,8 +191,8 @@ func TestWriteError(t *testing.T) { // encode back to writer encoder := NewEncoder(w) - if err := encoder.Encode(receiver); err != writerError { - t.Fatalf("expected error <%s>, got <%s>", writerError, err) + if err := encoder.Encode(receiver); err != errWriter { + t.Fatalf("expected error <%s>, got <%s>", errWriter, err) } }