exercism/xgo — pull request #41 by soniakeys (2014-06-01 20:47:34+00:00)
Title: Add robot-name ported from Ruby

Just a guess at what file names might work. Example.go and robot_name_test.go follow existing conventions. Example.go has a build tag in it but that has no effect when you test the program normally. robot_name_test.go has a comment mentioning bonus tasks, but not mentioning any other files. So, if existing stuff -- the cli and whatever else -- delivers just robot_name_test.go to the user, everything thing should look fine for the user.

The bonus solution is in the separate file bonus.go and the bonus test in bonus_test.go. If the cli can also deliver bonus_test.go, then we could update the Go help page with the `-tags bonus` instruction for running it.

If the current behavior of the cli is to deliver all .go files except example.go, we have a problem. It would deliver bonus.go, the bonus solution. It seems unlikely things would be written that way, but I thought I would mention it.

Finally, example.go and bonus.go have build constraints in them so that `go test` ignores runs example.go and ignores bonus.go. `go test -tags bonus` runs bonus.go and ignores runs bonus.go. This should allow both files to exist, for Travis for example. Also the user does not have use or understand this trick. He can write his program just as he normally would and use `-tags bonus` or not according to whether he wants to run the extra test in bonus_test.