Standard library / go/doc

go/doc.Synopsis()

Legacy first-sentence extraction; prefer Package.Synopsis for doc links. Expected stdout: 'First sentence.\n'.

Formal Syntax & Structure

go syntaxgo
func Synopsis(text string) string

Parameters & Attributes

NameTypeDescription
textstringInput to the operation as described above.

Return Value

string

Legacy first-sentence extraction; prefer Package.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/doc")
func main() { fmt.Println(doc.Synopsis("First sentence. Second sentence.")) }
Go Reference