File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change
1
+ ### Bonus exercise
2
+
3
+ Once you get ` go test ` passing, try ` go test -tags bonus ` . This uses a * build
4
+ tag* to enable a test that wasn't previously enabled. Build tags control which
5
+ files should be included in the package. You can read more about those at [ the
6
+ Go documentation] ( https://golang.org/pkg/go/build/#hdr-Build_Constraints ) .
7
+
8
+ For this exercise it limits ` go test ` to only build the tests in the
9
+ ` robot_name_test.go ` file. We can then include the bonus test in the
10
+ ` bonus_test.go ` file with the tags flag as described above.
11
+
12
+ To get the bonus test to pass you'll have to ensure a robot's name has not been
13
+ used before.
Original file line number Diff line number Diff line change 7
7
"math/rand"
8
8
)
9
9
10
+ const testVersion = 1
11
+
10
12
type Robot struct {
11
13
name string
12
14
}
You can’t perform that action at this time.
0 commit comments