<p dir="auto">How can I empty input stream?</p>
<p dir="auto">package main</p>
<p dir="auto">import (<br>
"fmt"<br>
)</p>
<p dir="auto">func main() {<br>
var a int<br>
var f float32<br>
var str string</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fmt.Print(&quot;Please input : &quot;)
fmt.Scanf(&quot;%d %f %s&quot;, &amp;a, &amp;f, &amp;str)
fmt.Println(&quot;Output: &quot;, a, f, str)

fmt.Println(&quot;----------------------------&quot;)

var sIP, sMac string
fmt.Print(&quot;Please input: &quot;)
fmt.Scanf(&quot;%s %s&quot;, &amp;sIP, &amp;sMac)

fmt.Println(&quot;Output: &quot;, sIP, sMac)"><pre class="notranslate"><code class="notranslate">fmt.Print("Please input : ")
fmt.Scanf("%d %f %s", &amp;a, &amp;f, &amp;str)
fmt.Println("Output: ", a, f, str)

fmt.Println("----------------------------")

var sIP, sMac string
fmt.Print("Please input: ")
fmt.Scanf("%s %s", &amp;sIP, &amp;sMac)

fmt.Println("Output: ", sIP, sMac)
</code></pre></div>
<p dir="auto">}</p>
<p dir="auto">OUTPUT：<br>
Please input : 1 3.24 hello</p>
<h2 dir="auto">Output:  1 3.24 hello</h2>
<p dir="auto">Please input: Output:</p>
<p dir="auto">How can I empty input stream?</p>
<p dir="auto">package main</p>
<p dir="auto">import (<br>
"fmt"<br>
)</p>
<p dir="auto">func main() {<br>
var a int<br>
var f float32<br>
var str string</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="fmt.Print(&quot;Please input : &quot;)
fmt.Scanf(&quot;%d %f %s&quot;, &amp;a, &amp;f, &amp;str)
fmt.Println(&quot;Output: &quot;, a, f, str)

fmt.Println(&quot;----------------------------&quot;)

var sIP, sMac string
fmt.Print(&quot;Please input: &quot;)
fmt.Scanf(&quot;%s %s&quot;, &amp;sIP, &amp;sMac)

fmt.Println(&quot;Output: &quot;, sIP, sMac)"><pre class="notranslate"><code class="notranslate">fmt.Print("Please input : ")
fmt.Scanf("%d %f %s", &amp;a, &amp;f, &amp;str)
fmt.Println("Output: ", a, f, str)

fmt.Println("----------------------------")

var sIP, sMac string
fmt.Print("Please input: ")
fmt.Scanf("%s %s", &amp;sIP, &amp;sMac)

fmt.Println("Output: ", sIP, sMac)
</code></pre></div>
<p dir="auto">}</p>