Refer a different package from the godoc of a package
Asked Answered
D

2

6

Can someone let me know if it is possible to refer a different package from godoc of a package? For example let's say I have a package src/logger/. In src/logger/doc.go I need to refer src/config/. Something like @see in javadoc.

Is there a recommended way?

I am on Go 1.7.

Davina answered 24/9, 2016 at 7:14 Comment(1)
Easiest examples is to look at Go's actual documentation on golang.org/pkg and browse around until you find it. Then click on the source file and look at the actual comments.Sigh
E
1

As of Go 1.19's enhancements to GoDoc, this is now possible with documentation links.

// Foo returns a [os.File].
func Foo() *os.File {
Endocrinotherapy answered 28/6, 2023 at 21:23 Comment(0)
N
4

I am not aware that this is currently possible. E.g. https://golang.org/pkg/io/ioutil/#TempFile refers to the os package simply using *os.File. See the source code comments at https://golang.org/src/io/ioutil/tempfile.go#L40.

and writing, and returns the resulting *os.File.

Nadenenader answered 24/9, 2016 at 14:22 Comment(0)
E
1

As of Go 1.19's enhancements to GoDoc, this is now possible with documentation links.

// Foo returns a [os.File].
func Foo() *os.File {
Endocrinotherapy answered 28/6, 2023 at 21:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.