Skip to content
Permalink
Browse files
Added support for go.mod files (#3209)
  • Loading branch information
RunDevelopment committed Dec 5, 2021
1 parent 969f152 commit 8476a9abed2080b99d4f1e39a8ef7defacd2bea4

Large diffs are not rendered by default.

@@ -495,6 +495,11 @@
"require": "clike",
"owner": "arnehormann"
},
"go-module": {
"title": "Go module",
"alias": "go-mod",
"owner": "RunDevelopment"
},
"graphql": {
"title": "GraphQL",
"optional": "markdown",
@@ -0,0 +1,24 @@
// https://go.dev/ref/mod#go-mod-file-module

Prism.languages['go-mod'] = Prism.languages['go-module'] = {
'comment': {
pattern: /\/\/.*/,
greedy: true
},
'version': {
pattern: /(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/,
lookbehind: true,
alias: 'number'
},
'go-version': {
pattern: /((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/,
lookbehind: true,
alias: 'number'
},
'keyword': {
pattern: /^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m,
lookbehind: true
},
'operator': /=>/,
'punctuation': /[()[\],]/
};

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,15 @@
<h2>Full example</h2>
<pre><code>// Source: https://go.dev/doc/modules/gomod-ref#example

module example.com/mymodule

go 1.14

require (
example.com/othermodule v1.2.3
example.com/thismodule v1.2.3
example.com/thatmodule v1.2.3
)

replace example.com/thatmodule => ../thatmodule
exclude example.com/thismodule v1.3.0</code></pre>
@@ -197,6 +197,7 @@
"xls": "excel-formula",
"gamemakerlanguage": "gml",
"gni": "gn",
"go-mod": "go-module",
"hbs": "handlebars",
"hs": "haskell",
"idr": "idris",

Some generated files are not rendered by default. Learn more.

@@ -98,6 +98,8 @@
"glsl": "GLSL",
"gn": "GN",
"gni": "GN",
"go-module": "Go module",
"go-mod": "Go module",
"graphql": "GraphQL",
"hbs": "Handlebars",
"hs": "Haskell",

0 comments on commit 8476a9a

Please sign in to comment.