title: View package documentation locally in a browser
body: <p>I want to see locally how my package documentation will look.  That is, I want to see the same kind of thing you see on <a href="https://godoc.org/strings" rel="nofollow noreferrer">godoc.org</a>, but locally.</p>
  <p>I have a simple example folder locally, but I can't get it to work.  It correctly outputs text documentation:</p>
  <pre><code>~/code/go/gonotes (master) $ godoc .
  PACKAGE DOCUMENTATION
  
  package gonotes
      import &quot;.&quot;
  
  
  FUNCTIONS
  
  func Blah()
      Here is header
  
      Blah is function being use to test:
  
      - go documentation
      - blah like things
  
      It is nice
  </code></pre>
  <p>But if I run <code>godoc -http=:6060</code>, and navigate to <code>http://localhost:6060/</code>, I see essentially the same content I'd see on the golang.com homepage.  <code>http://localhost:6060/gonotes</code> displays</p>
  <pre><code>lstat $GOROOT/gonotes: no such file or directory
  </code></pre>
  <p>Am I misunderstanding how the <code>-http</code> works?  Is there any way to preview the http version of my docs locally?</p>
  <h2>UPDATE</h2>
  <p>I was able to get it to appear by copying the files into <code>src/gonotes</code> and then running:</p>
  <pre><code>GOPATH=/Users/jonah/code/go/gonotes godoc -http=:6060
  </code></pre>
  <p>so that the actual files were available at <code>/Users/jonah/code/go/gonotes/src/gonotes</code>.</p>
  <p>This has the side effect of not showing any of the Third part libs installed in my default <code>GOPATH</code>, so I'd still like to find a solution that just allows me to add the current directory, as is, without adding <code>src/curdir</code> to it, and still have it show up.</p>