Re: [go-nuts] Re: Why do I get multiple times the same data?

2021-08-18 Thread hyogy hyogy
Thanks!(: Resetting the buffer was the solution! May I ask another tip 
please?

Il giorno venerdì 30 luglio 2021 alle 19:03:41 UTC+2 Vadim Berezniker ha 
scritto:

> fub is declared outside the for loop and io.Copy(, ) will append to 
> the buffer. 
>
> On Thu, Jul 29, 2021 at 11:41 AM hyogy hyogy  wrote:
>
>> I am more and more convinced that *io.Copy(, )* is the problem
>>
>> Il giorno mercoledì 28 luglio 2021 alle 17:11:40 UTC+2 hyogy hyogy ha 
>> scritto:
>>
>>> I have recently added a ROT13 logic to a tool of mine.
>>> This tool connects to a server, from which I run commands on the client.
>>>
>>> Here is the code PRE-ROT13:
>>> https://play.golang.org/p/DAE4cLq3RSx
>>> Everything works like a charm.
>>>
>>> Here is the code POST-ROR13. The difference between them is underlined
>>> https://play.golang.org/p/DfFJSvuBx05
>>>
>>> Both functions handle the output of the commands.
>>> The ROT13 works fine, but I get the same output multiple time, which 
>>> before did not happen. Infact, if I revert the changes, everything works 
>>> perfectly.
>>> Example:
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>> *xnyv*
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>> *xnyv*
>>> *xnyv*
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>> *xnyv*
>>> *xnyv*
>>> *xnyv*
>>>
>>> Why do I get this result? How can I fix it?
>>> May be fub's fault? It is like if the output get cached somehow, but I 
>>> may be wrong.
>>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>>
> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/865969bf-d6e4-49ca-9ed5-809efae2f25cn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/189af17d-93c7-4031-998f-cb19730e69fcn%40googlegroups.com.


Re: [go-nuts] Re: Why do I get multiple times the same data?

2021-08-18 Thread LetGo
Resetting the buffer was the right solution! Thanks(:! May I ask another 
tip please?

Il giorno venerdì 30 luglio 2021 alle 19:03:41 UTC+2 Vadim Berezniker ha 
scritto:

> fub is declared outside the for loop and io.Copy(, ) will append to 
> the buffer. 
>
> On Thu, Jul 29, 2021 at 11:41 AM hyogy hyogy  wrote:
>
>> I am more and more convinced that *io.Copy(, )* is the problem
>>
>> Il giorno mercoledì 28 luglio 2021 alle 17:11:40 UTC+2 hyogy hyogy ha 
>> scritto:
>>
>>> I have recently added a ROT13 logic to a tool of mine.
>>> This tool connects to a server, from which I run commands on the client.
>>>
>>> Here is the code PRE-ROT13:
>>> https://play.golang.org/p/DAE4cLq3RSx
>>> Everything works like a charm.
>>>
>>> Here is the code POST-ROR13. The difference between them is underlined
>>> https://play.golang.org/p/DfFJSvuBx05
>>>
>>> Both functions handle the output of the commands.
>>> The ROT13 works fine, but I get the same output multiple time, which 
>>> before did not happen. Infact, if I revert the changes, everything works 
>>> perfectly.
>>> Example:
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>> *xnyv*
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>> *xnyv*
>>> *xnyv*
>>>
>>> *$ whoami*
>>> *$ xnyv*
>>> *xnyv*
>>> *xnyv*
>>> *xnyv*
>>>
>>> Why do I get this result? How can I fix it?
>>> May be fub's fault? It is like if the output get cached somehow, but I 
>>> may be wrong.
>>>
>> -- 
>>
> You received this message because you are subscribed to the Google Groups 
>> "golang-nuts" group.
>>
> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to golang-nuts...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/865969bf-d6e4-49ca-9ed5-809efae2f25cn%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4453654b-76cf-4b4e-9cbf-6d8d6d96a030n%40googlegroups.com.


Re: [go-nuts] Re: Why do I get multiple times the same data?

2021-07-30 Thread Vadim Berezniker
fub is declared outside the for loop and io.Copy(, ) will append to
the buffer.

On Thu, Jul 29, 2021 at 11:41 AM hyogy hyogy  wrote:

> I am more and more convinced that *io.Copy(, )* is the problem
>
> Il giorno mercoledì 28 luglio 2021 alle 17:11:40 UTC+2 hyogy hyogy ha
> scritto:
>
>> I have recently added a ROT13 logic to a tool of mine.
>> This tool connects to a server, from which I run commands on the client.
>>
>> Here is the code PRE-ROT13:
>> https://play.golang.org/p/DAE4cLq3RSx
>> Everything works like a charm.
>>
>> Here is the code POST-ROR13. The difference between them is underlined
>> https://play.golang.org/p/DfFJSvuBx05
>>
>> Both functions handle the output of the commands.
>> The ROT13 works fine, but I get the same output multiple time, which
>> before did not happen. Infact, if I revert the changes, everything works
>> perfectly.
>> Example:
>>
>> *$ whoami*
>> *$ xnyv*
>>
>> *$ whoami*
>> *$ xnyv*
>> *xnyv*
>>
>> *$ whoami*
>> *$ xnyv*
>> *xnyv*
>> *xnyv*
>>
>> *$ whoami*
>> *$ xnyv*
>> *xnyv*
>> *xnyv*
>> *xnyv*
>>
>> Why do I get this result? How can I fix it?
>> May be fub's fault? It is like if the output get cached somehow, but I
>> may be wrong.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/865969bf-d6e4-49ca-9ed5-809efae2f25cn%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CALoVpBJR%2BT5UD-5j1ycFkMfUNuZX-No2FjGhnQXN%2BuueVdbCdw%40mail.gmail.com.


[go-nuts] Re: Why do I get multiple times the same data?

2021-07-29 Thread hyogy hyogy
I am more and more convinced that *io.Copy(, )* is the problem

Il giorno mercoledì 28 luglio 2021 alle 17:11:40 UTC+2 hyogy hyogy ha 
scritto:

> I have recently added a ROT13 logic to a tool of mine.
> This tool connects to a server, from which I run commands on the client.
>
> Here is the code PRE-ROT13:
> https://play.golang.org/p/DAE4cLq3RSx
> Everything works like a charm.
>
> Here is the code POST-ROR13. The difference between them is underlined
> https://play.golang.org/p/DfFJSvuBx05
>
> Both functions handle the output of the commands.
> The ROT13 works fine, but I get the same output multiple time, which 
> before did not happen. Infact, if I revert the changes, everything works 
> perfectly.
> Example:
>
> *$ whoami*
> *$ xnyv*
>
> *$ whoami*
> *$ xnyv*
> *xnyv*
>
> *$ whoami*
> *$ xnyv*
> *xnyv*
> *xnyv*
>
> *$ whoami*
> *$ xnyv*
> *xnyv*
> *xnyv*
> *xnyv*
>
> Why do I get this result? How can I fix it?
> May be fub's fault? It is like if the output get cached somehow, but I may 
> be wrong.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/865969bf-d6e4-49ca-9ed5-809efae2f25cn%40googlegroups.com.