UNPKG

1.21 kBJavaScriptView Raw
1/*! `go` grammar compiled for Highlight.js 11.6.0 */
2(()=>{var e=(()=>{"use strict";return e=>{const n={
3keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],
4type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],
5literal:["true","false","iota","nil"],
6built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]
7};return{name:"Go",aliases:["golang"],keywords:n,illegal:"</",
8contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",
9variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{
10className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1
11},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",
12end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",
13begin:/\(/,end:/\)/,endsParent:!0,keywords:n,illegal:/["']/}]}]}}})()
14;hljs.registerLanguage("go",e)})();
\No newline at end of file