Skip to content

Commit

Permalink
hw11. is completed. linter check
Browse files Browse the repository at this point in the history
  • Loading branch information
DimVlas committed Jan 6, 2025
1 parent 9585f74 commit 27a612b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
4 changes: 2 additions & 2 deletions hw11_telnet_client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var (
ErrParseArgs = errors.New("parse args error")
// соединение не установлено.
ErrConnNotEstablish = errors.New("connection is not established")
// завершение клиента
// завершение клиента.
ErrClientExit = errors.New("connection was closed by client")
// завершение сервера
// завершение сервера.
ErrServerExit = errors.New("connection was closed by peer")
)

Expand Down
7 changes: 2 additions & 5 deletions hw11_telnet_client/telnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ func TestTelnetClient(t *testing.T) {
conn := client.(*telnetClient).conn

in.WriteString("hello\n")
require.EqualError(t, client.Send(), "write tcp "+conn.LocalAddr().String()+"->"+conn.RemoteAddr().String()+": write: connection reset by peer")
require.EqualError(t, client.Send(),
"write tcp "+conn.LocalAddr().String()+"->"+conn.RemoteAddr().String()+": write: connection reset by peer")

// при получении возращает EOF, который перехватывается т.к. трактуется как корректное окончание
require.NoError(t, client.Receive())
Expand Down Expand Up @@ -188,7 +189,6 @@ var testParamData = []struct {
}

func TestParseArgs(t *testing.T) {

for _, data := range testParamData {
t.Run(data.name, func(t *testing.T) {
var (
Expand All @@ -207,9 +207,6 @@ func TestParseArgs(t *testing.T) {

require.Equal(t, data.host, host)
require.Equal(t, data.port, port)

})

}

}

0 comments on commit 27a612b

Please sign in to comment.