A Go (Golang) code syntax highlighting library. It uses automatically converted
highlight.js language definitions.
package main
import "github.com/d4l3k/go-highlight"
func main() {
highlight.Highlight("go", `
package main
import "fmt"
func main() {
fmt.Println("Duck!")
}
`)
/*
<keyword>package</keyword> main
<keyword>import</keyword> <string>"fmt"</string>
<keyword>func</keyword> main() {
fmt.Println(<string>"Duck!"</string>)
}
*/
}
The code written by Tristan Rice is licensed under the MIT license.
The language definitions are ported from
highlight.js which is licensed
under the BSD licence.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.