whether Golang can achieve buffer output similar to PHP
I am now using beego for Web development, and I want to achieve a similar function:
Thepage prints numbers from 1 to 10000000, operates using a loop, and then outputs the current number each time it loops.
if the operation is normal, then when the page is displayed, all the numbers have been displayed, so that the effect I want will not be achieved.
is there a way for me to open the page and start to execute a loop, each time a number is output in the page, instead of displaying the page after all the loops and output is complete?
PHP can be implemented with functions such as ob_flush
, but golang is not quite clear how to implement it.