Re: [go-nuts] godoc: example wont show up

2017-03-06 Thread Janne Snabb
It seems it is because it is "package main". See $GOPATH/src/golang.org/x/tools/godoc/static/package.html template. "IsMain" is set if the package is called "main". Looks like there is no way to output examples in that case. Janne Snabb sn...@epipe.com On 2017-03-06 19:25, mhhc...@gmail.com wr

Re: [go-nuts] godoc: example wont show up

2017-03-06 Thread mhhcbon
thanks for your reply. yeah, that s right, ok, but what about TOC#5 ? That should work too, To achieve this we can use a "whole file example." A whole file example is a file that ends in _test.go✓ contains exactly one example function, ✓ no test

Re: [go-nuts] godoc: example wont show up

2017-03-06 Thread Janne Snabb
Your example function is named ExampleMain(). This means that it is supposed to document function Main() or type Main. However, there is no function Main() or type Main in the package. Thus the example is not visible in the documentation because there is nothing for it to attach to. See for examp

[go-nuts] godoc: example wont show up

2017-03-06 Thread mhhcbon
Hi, in my package here, what did i do wrong so the ExampleMain won t show up ? https://github.com/mh-cbon/emd https://godoc.org/github.com/mh-cbon/emd Im expecting to see https://github.com/mh-cbon/emd/blob/master/main_test.go#L13 Note, go test works fine. thanks! -- You received this messa