Standard library / go/doc/comment
go/doc/comment.DocLink.DefaultURL()
Builds the URL for a Go documentation symbol using a base prefix. Expected stdout: '/pkg/fmt/#Println\n'.
Formal Syntax & Structure
go syntaxgo
func (l *DocLink) DefaultURL(baseURL string) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| baseURL | string | Input to the operation as described above. |
Return Value
string
Builds the URL for a Go documentation symbol using a base prefix.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/doc/comment")
func main() { l := comment.DocLink{ImportPath: "fmt", Name: "Println"} fmt.Println(l.DefaultURL("/pkg/"))}