File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,10 @@ func main() {
2828 logrus .Fatal (err )
2929 }
3030
31- id := string (msg )
32-
3331 client := jsonrpc .NewClient (ws .UnderlyingConn ())
3432 defer client .Close ()
3533
34+ id := string (msg )
3635 go getUnreadMessages (id , client )
3736
3837 fmt .Println (
@@ -56,7 +55,7 @@ func main() {
5655 fmt .Println ("Ваш id:" , id )
5756 default :
5857 sending := strings .Split (text , " %$4^b " )
59- if len (sending ) == 0 {
58+ if len (sending ) == 0 || len ( sending ) > 2 {
6059 logrus .Error ("Неккоректный формат входных данных" )
6160 continue
6261 }
@@ -75,7 +74,9 @@ func getUnreadMessages(id string, client *rpc.Client) {
7574 var result * []string
7675 if err := client .Call ("Handler.GetMessages" , args , & result ); err != nil {
7776 logrus .Fatal (err )
78- } else if len (* result ) != 0 {
77+ }
78+
79+ if len (* result ) != 0 {
7980 for _ , msg := range * result {
8081 logrus .Println (msg )
8182 }
You can’t perform that action at this time.
0 commit comments