Похожие чаты

How can I grab the text pending on console input

(before user press enter to confirm) ?

5 ответов

8 просмотров
DAZ- Автор вопроса

It wasn't easy but I was able to make it work: https://go.dev/play/p/FUxl_5SNUwA The only doubt I have is with the ReadWriter, for some mysterious reasons the following code didn't work: bufio.NewReadWriter( bufio.NewReader(os.Stdin), bufio.NewWriter(os.Stdout), ) can someone explain to me why or give a cleaner solution then mine?

DAZ
It wasn't easy but I was able to make it work: htt...

You also probably want to make the channel handling in a separate for loop inside a goroutine

DAZ- Автор вопроса
Amir
Bufio I believe needs delimiters

Not always, there is bufio.NewReader and bufio.NewWriter that don't need it

Похожие вопросы

Обсуждают сегодня

И ещё вопрос: можно ли типа как на дос как-то запариться и с помощью прерываний выводить текст, вместо функции printf ?
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
34
'frakturBold' => ['𝖆', '𝖇', '𝖈', '𝖉', '𝖊', '𝖋', '𝖌', '𝖍', '𝖎', '𝖏', '𝖐', '𝖑', '𝖒', '𝖓', '𝖔', '𝖕', '𝖖', '𝖗', '𝖘', '𝖙', '𝖚', '𝖛', '𝖜', '𝖝', '𝖞', '𝖟', '𝕬', '𝕭', '𝕮', '𝕯'...
Roma
4
Ладно, ещё тупого спрошу. Код должен банально вывести значение регистра на консоль, на деле же не выводя ничего, просто оставляя нерабочую консоль (открыта, ничего не написан...
НѣкъиⰘижєжєиꙁъвьсєсвѣтьноѣсѣтиѥсть•
25
здравствуйте. пытаюсь проверить, содержится ли в десятичном представлении инта некоторая цифра. совершаю: strstr(x, "5") != NULL) получаю ошибку с фото (заведомо неработающий ...
Катя Шевчук🪇
17
Let me insert my "5++" kilocents into how zcash should be positioned (and how it would have been positioned/adopted from day one). You are allowed to believe or not believe in...
eBiker
5
Что там вообще с кроссплатформенностью?
🄼🄰🄺🅉🄰🄸
23
How did we have so many dormant scammers in here? Who are these people. It’s been years. We know each other. If you dm me “I’ve been an og” but haven’t said a single word her...
Justin | LGCY |
49
{ char buff = *start; *start = *end; *end = buff; } Из-за этой строчки? Что каждый символ через перем бафф? Как вариант использовать другие со...
Wenks
12
Hello Everyone 🙌🏻💜 Happy (?) Friday to everyone 😁😁 I have read through all the comments/feedback/complaints in the last 2 days following the CEO Update AMA. Clearly the ...
Patrick - Ultra.io
5
In a country where censorship and arbitrary decisions are the order of the day, offering a message of hope to workers and youth is necessary, but it is only possible with expe...
Ibrahim Rabiu
1
Карта сайта