eatnumber1/goal — pull request #141 by steven099 (2014-07-28 17:26:50+00:00)
Title: Potentially more idiomatic solution for Go

This solution uses a closure to store the state of the result string rather than using global state. The function type of the closure, `OStringBuilder`, implements `fmt.Stringer`, which is an interface in Go which allows an arbitrary type to be printed as a string. A special argument type, `oSBResult`, is used to extract the result from the closure in the implementation of `fmt.Stringer` for `OStringBuilder`. This solution is general in that the `OStringBuilder` type can be used to build any string containing "o"s. It uses a `bytes.Buffer` to build the result, which should be more efficient for longer "goal" strings compared to appending one character to a string at a time.