Example output not visible in godoc

60 views
Skip to first unread message

snmed

unread,
Sep 25, 2017, 4:54:57 AM9/25/17
to golang-nuts
Hi all

I have some problem with my go examples, in some case the output is correct rendered in a code block, but for other examples it is not rendered in a separat code block.

Here the link to the documentation of my package: https://godoc.org/bitbucket.org/snmed/sting

For example GetService the output is rendered correct.
For example Inject it is not rendered correct.

Has anyone an idea why it is no working correct?

Thank you in advance
Sandro

Jan Mercl

unread,
Sep 25, 2017, 5:03:55 AM9/25/17
to snmed, golang-nuts
On Mon, Sep 25, 2017 at 10:55 AM snmed <sandro....@gmail.com> wrote:

> Has anyone an idea why it is no working correct?

--

-j

snmed

unread,
Sep 25, 2017, 5:18:18 AM9/25/17
to golang-nuts
Thank you for your answer, but nope doesn't make any difference, at least not with local godoc instance.

snmed

unread,
Sep 26, 2017, 1:08:16 AM9/26/17
to golang-nuts
Hi all

I found the problem, but i'm not sure if it's a bug or not. If i move the type and function declarations to a different file, it works as it should.
But as described here: https://blog.golang.org/examples it should be possible to use own types in the examples.

By the way i'm using go 1.9 on macOS, maybe someone can test if this behavior is the same for 1.8.3.
Also i wondering if godoc.org is on version 1.9 or does it use an older version?

Cheers
Reply all
Reply to author
Forward
0 new messages