How to create document in GO with godoc?











up vote
-1
down vote

favorite












I create simple go with comment in the application to the function and the package
I tried godoc -html and my application and the result



<!--
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
-->

<!--
Note: Static (i.e., not template-generated) href and id
attributes start with "pkg-" to make it impossible for
them to conflict with generated attributes (some of which
correspond to Go identifiers).
-->

<script type='text/javascript'>
document.ANALYSIS_DATA = ;
document.CALLGRAPH = ;
</script>



<p>
Package main provides logic ...
</p>


why I didn't see my other document ? and why the <p> for the package has spaces



// Package main provides logic.
package main
import (

}

some types.....

func main() {
}

// doLogic .....
// .....
// ....
func (sm *myI) doLogic (s *myStruct) bool {

}









share|improve this question




























    up vote
    -1
    down vote

    favorite












    I create simple go with comment in the application to the function and the package
    I tried godoc -html and my application and the result



    <!--
    Copyright 2009 The Go Authors. All rights reserved.
    Use of this source code is governed by a BSD-style
    license that can be found in the LICENSE file.
    -->

    <!--
    Note: Static (i.e., not template-generated) href and id
    attributes start with "pkg-" to make it impossible for
    them to conflict with generated attributes (some of which
    correspond to Go identifiers).
    -->

    <script type='text/javascript'>
    document.ANALYSIS_DATA = ;
    document.CALLGRAPH = ;
    </script>



    <p>
    Package main provides logic ...
    </p>


    why I didn't see my other document ? and why the <p> for the package has spaces



    // Package main provides logic.
    package main
    import (

    }

    some types.....

    func main() {
    }

    // doLogic .....
    // .....
    // ....
    func (sm *myI) doLogic (s *myStruct) bool {

    }









    share|improve this question


























      up vote
      -1
      down vote

      favorite









      up vote
      -1
      down vote

      favorite











      I create simple go with comment in the application to the function and the package
      I tried godoc -html and my application and the result



      <!--
      Copyright 2009 The Go Authors. All rights reserved.
      Use of this source code is governed by a BSD-style
      license that can be found in the LICENSE file.
      -->

      <!--
      Note: Static (i.e., not template-generated) href and id
      attributes start with "pkg-" to make it impossible for
      them to conflict with generated attributes (some of which
      correspond to Go identifiers).
      -->

      <script type='text/javascript'>
      document.ANALYSIS_DATA = ;
      document.CALLGRAPH = ;
      </script>



      <p>
      Package main provides logic ...
      </p>


      why I didn't see my other document ? and why the <p> for the package has spaces



      // Package main provides logic.
      package main
      import (

      }

      some types.....

      func main() {
      }

      // doLogic .....
      // .....
      // ....
      func (sm *myI) doLogic (s *myStruct) bool {

      }









      share|improve this question















      I create simple go with comment in the application to the function and the package
      I tried godoc -html and my application and the result



      <!--
      Copyright 2009 The Go Authors. All rights reserved.
      Use of this source code is governed by a BSD-style
      license that can be found in the LICENSE file.
      -->

      <!--
      Note: Static (i.e., not template-generated) href and id
      attributes start with "pkg-" to make it impossible for
      them to conflict with generated attributes (some of which
      correspond to Go identifiers).
      -->

      <script type='text/javascript'>
      document.ANALYSIS_DATA = ;
      document.CALLGRAPH = ;
      </script>



      <p>
      Package main provides logic ...
      </p>


      why I didn't see my other document ? and why the <p> for the package has spaces



      // Package main provides logic.
      package main
      import (

      }

      some types.....

      func main() {
      }

      // doLogic .....
      // .....
      // ....
      func (sm *myI) doLogic (s *myStruct) bool {

      }






      go godoc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 10:35









      Flimzy

      1




      1










      asked Nov 7 at 10:33









      user1365697

      2,033103764




      2,033103764
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Unexported identifiers are not documented by default. Set at least ?m=all to see them:




          The presentation mode of web pages served by godoc can be controlled with the "m" URL parameter; it accepts a comma-separated list of flag names as value:



          all     show documentation for all declarations, not just the exported ones
          methods show all embedded methods, not just those of unexported anonymous fields
          src show the original source code rather then the extracted documentation


          For instance, https://golang.org/pkg/math/big/?m=all shows the documentation for all (not just the exported) declarations of package big.
          https://godoc.org/golang.org/x/tools/cmd/godoc







          share|improve this answer





















          • what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
            – user1365697
            Nov 7 at 11:24










          • can I run it with godoc -http=:6060 ? P.S how I can export method ?
            – user1365697
            Nov 7 at 11:24










          • i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
            – user1365697
            Nov 7 at 11:29










          • The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
            – Peter
            Nov 7 at 11:57











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187692%2fhow-to-create-document-in-go-with-godoc%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          Unexported identifiers are not documented by default. Set at least ?m=all to see them:




          The presentation mode of web pages served by godoc can be controlled with the "m" URL parameter; it accepts a comma-separated list of flag names as value:



          all     show documentation for all declarations, not just the exported ones
          methods show all embedded methods, not just those of unexported anonymous fields
          src show the original source code rather then the extracted documentation


          For instance, https://golang.org/pkg/math/big/?m=all shows the documentation for all (not just the exported) declarations of package big.
          https://godoc.org/golang.org/x/tools/cmd/godoc







          share|improve this answer





















          • what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
            – user1365697
            Nov 7 at 11:24










          • can I run it with godoc -http=:6060 ? P.S how I can export method ?
            – user1365697
            Nov 7 at 11:24










          • i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
            – user1365697
            Nov 7 at 11:29










          • The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
            – Peter
            Nov 7 at 11:57















          up vote
          2
          down vote



          accepted










          Unexported identifiers are not documented by default. Set at least ?m=all to see them:




          The presentation mode of web pages served by godoc can be controlled with the "m" URL parameter; it accepts a comma-separated list of flag names as value:



          all     show documentation for all declarations, not just the exported ones
          methods show all embedded methods, not just those of unexported anonymous fields
          src show the original source code rather then the extracted documentation


          For instance, https://golang.org/pkg/math/big/?m=all shows the documentation for all (not just the exported) declarations of package big.
          https://godoc.org/golang.org/x/tools/cmd/godoc







          share|improve this answer





















          • what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
            – user1365697
            Nov 7 at 11:24










          • can I run it with godoc -http=:6060 ? P.S how I can export method ?
            – user1365697
            Nov 7 at 11:24










          • i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
            – user1365697
            Nov 7 at 11:29










          • The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
            – Peter
            Nov 7 at 11:57













          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Unexported identifiers are not documented by default. Set at least ?m=all to see them:




          The presentation mode of web pages served by godoc can be controlled with the "m" URL parameter; it accepts a comma-separated list of flag names as value:



          all     show documentation for all declarations, not just the exported ones
          methods show all embedded methods, not just those of unexported anonymous fields
          src show the original source code rather then the extracted documentation


          For instance, https://golang.org/pkg/math/big/?m=all shows the documentation for all (not just the exported) declarations of package big.
          https://godoc.org/golang.org/x/tools/cmd/godoc







          share|improve this answer












          Unexported identifiers are not documented by default. Set at least ?m=all to see them:




          The presentation mode of web pages served by godoc can be controlled with the "m" URL parameter; it accepts a comma-separated list of flag names as value:



          all     show documentation for all declarations, not just the exported ones
          methods show all embedded methods, not just those of unexported anonymous fields
          src show the original source code rather then the extracted documentation


          For instance, https://golang.org/pkg/math/big/?m=all shows the documentation for all (not just the exported) declarations of package big.
          https://godoc.org/golang.org/x/tools/cmd/godoc








          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 at 11:20









          Peter

          14.9k42032




          14.9k42032












          • what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
            – user1365697
            Nov 7 at 11:24










          • can I run it with godoc -http=:6060 ? P.S how I can export method ?
            – user1365697
            Nov 7 at 11:24










          • i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
            – user1365697
            Nov 7 at 11:29










          • The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
            – Peter
            Nov 7 at 11:57


















          • what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
            – user1365697
            Nov 7 at 11:24










          • can I run it with godoc -http=:6060 ? P.S how I can export method ?
            – user1365697
            Nov 7 at 11:24










          • i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
            – user1365697
            Nov 7 at 11:29










          • The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
            – Peter
            Nov 7 at 11:57
















          what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
          – user1365697
          Nov 7 at 11:24




          what should I need to add to the command godoc -html -src c:/Users/go/src/myProject ?
          – user1365697
          Nov 7 at 11:24












          can I run it with godoc -http=:6060 ? P.S how I can export method ?
          – user1365697
          Nov 7 at 11:24




          can I run it with godoc -http=:6060 ? P.S how I can export method ?
          – user1365697
          Nov 7 at 11:24












          i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
          – user1365697
          Nov 7 at 11:29




          i run this command godoc -http=:6060 -goroot=$GOHOME and then i run localhost:6060?m=all then I succeed to get the struct but not the function
          – user1365697
          Nov 7 at 11:29












          The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
          – Peter
          Nov 7 at 11:57




          The main package can't be documented by the default godoc. See stackoverflow.com/questions/21778556/…
          – Peter
          Nov 7 at 11:57


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53187692%2fhow-to-create-document-in-go-with-godoc%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini