Skip to content

Commit 2f9a56d

Browse files
authored
Merge pull request #78 from pityonline/fix-iteration
trivial grammar and style tweak on iteration.md
2 parents ed8f5ce + 545f786 commit 2f9a56d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

iteration.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/for)**
44

5-
To do stuff repeatedly in Go, you'll need `for`. In go there are no `while`, `do`, `until` keywords, you can only use `for`. Which is a good thing!
5+
To do stuff repeatedly in Go, you'll need `for`. In Go there are no `while`, `do`, `until` keywords, you can only use `for`. Which is a good thing!
66

77
Let's write a test for a function that repeats a character 5 times.
88

@@ -38,7 +38,7 @@ All you need to do right now is enough to make it compile so you can check your
3838
```go
3939
package iteration
4040

41-
func Repeat(character string) string {
41+
func Repeat(character string) string {
4242
return ""
4343
}
4444
```
@@ -103,7 +103,7 @@ The `testing.B` gives you access to the cryptically named `b.N`.
103103

104104
When the benchmark is run the code is ran `b.N` times, and measures how long it takes.
105105

106-
The amount of times the code is ran shouldnt matter to you, the framework will determine what is a "good" value for that to let you have some decent results.
106+
The amount of times the code is ran shouldn't matter to you, the framework will determine what is a "good" value for that to let you have some decent results.
107107

108108
To run the benchmarks do `go test -bench=.`
109109

@@ -123,10 +123,10 @@ _NOTE_ by default Benchmarks are run sequentially.
123123

124124
* Change the test so a caller can specify how many times the character is repeated and then fix the code
125125
* Write `ExampleRepeat` to document your function
126-
* Have a look through the [the strings package](https://golang.org/pkg/strings) package. Find functions you think could be useful and experiment with them by writing tests like we have here. Investing time learning the standard library will really pay off over time.
126+
* Have a look through the [the strings](https://golang.org/pkg/strings) package. Find functions you think could be useful and experiment with them by writing tests like we have here. Investing time learning the standard library will really pay off over time.
127127

128128
## Wrapping up
129129

130130
* More TDD practice
131-
* Learned `for`.
131+
* Learned `for`
132132
* Learned how to write benchmarks

0 commit comments

Comments
 (0)