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 {
}
go godoc
add a comment |
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 {
}
go godoc
add a comment |
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 {
}
go godoc
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
go godoc
edited Nov 7 at 10:35
Flimzy
1
1
asked Nov 7 at 10:33
user1365697
2,033103764
2,033103764
add a comment |
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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