Skip to content

Commit 4a95e0b

Browse files
committed
remove printf
1 parent 27924cf commit 4a95e0b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -262,13 +262,13 @@ <h3>Loops</h3>
262262
<p>Go only has the <code>for</code> loop, but it has different kinds.</p>
263263
<p>There's the Java-style for loop.</p>
264264
<pre><code>for i := 0; i &lt; 10; i++ {
265-
fmt.Printf(&quot;for loop iteration: %d\n&quot;, i)
265+
fmt.Println(&quot;for loop iteration&quot;, i)
266266
}
267267
</code></pre>
268268
<p>And also the for-loop-that-should-really-be-a-while-loop.</p>
269269
<pre><code>j := 0
270270
for j &lt; 10 {
271-
fmt.Printf(&quot;while loop iteration: %d\n&quot;, j)
271+
fmt.Println(&quot;while loop iteration&quot;, j)
272272
j++
273273
}</code></pre>
274274

@@ -284,7 +284,7 @@ <h3>Loops</h3>
284284
<p>There's also the infinite for loop. Usually you'd have a <code>break</code> somewhere in the loop in order to stop it.</p>
285285
<pre><code>k := 0
286286
for {
287-
fmt.Printf(&quot;infinite loop iteration: %d\n&quot;, k)
287+
fmt.Println(&quot;infinite loop iteration&quot;, k)
288288
k++
289289
}</code></pre>
290290

introduction-to-go.slide

+3-3
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,14 @@ Go only has the `for` loop, but it has different kinds.
129129
There's the Java-style for loop.
130130

131131
for i := 0; i < 10; i++ {
132-
fmt.Printf("for loop iteration: %d\n", i)
132+
fmt.Println("for loop iteration", i)
133133
}
134134

135135
And also the for-loop-that-should-really-be-a-while-loop.
136136

137137
j := 0
138138
for j < 10 {
139-
fmt.Printf("while loop iteration: %d\n", j)
139+
fmt.Println("while loop iteration", j)
140140
j++
141141
}
142142

@@ -146,7 +146,7 @@ There's also the infinite for loop. Usually you'd have a `break` somewhere in th
146146

147147
k := 0
148148
for {
149-
fmt.Printf("infinite loop iteration: %d\n", k)
149+
fmt.Println("infinite loop iteration", k)
150150
k++
151151
}
152152

0 commit comments

Comments
 (0)