...
Package quick
Package quick provides simple, no-configuration source code highlighting.
▾ Example
Code:
code := `package main
func main() { }
`
err := quick.Highlight(os.Stdout, code, "go", "html", "monokai")
if err != nil {
log.Fatal(err)
}
func Highlight(w io.Writer, source, lexer, formatter, style string) error
Highlight some text.
Lexer, formatter and style may be empty, in which case a best-effort is made.