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) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| text | string | Input 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.")) }