title: What is the point of "examples" in the go (golang) testing framework?
body: <p>I was recently reading on <a href="http://golang.org/pkg/testing/#pkg-examples" rel="noreferrer">testing and examples</a> in the go testing framework and did not really understand what they were for. I see that the documentation says:</p>
  
  <blockquote>
    <p>The package also runs and verifies example code. Example functions may include a concluding line comment that begins with "Output:" and is compared with the standard output of the function when the tests are run. (The comparison ignores leading and trailing space.)</p>
  </blockquote>
  
  <p>However, I don't really appreciate the reason that this would exist. As I write my tests, it seems that it should be more than clear how to use the code just by reading the unit tests and the benchmarks. What additional motivation does the example section provide? It seems redundant to me, however, I am sure that the inventors of go put it for a good reason, specially because they seem to empathizes good programming practice by the design of their language. I hope to understand either their motivation or how this part of language can be used in a positive way in a golang project! :) </p>