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) string

Parameters & Attributes

NameTypeDescription
baseURLstringInput 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/"))}
Go Reference