| 1 |
filetype: gomod |
| 2 |
|
| 3 |
detect: |
| 4 |
filename: "go.mod" |
| 5 |
|
| 6 |
rules: |
| 7 |
# URL |
| 8 |
- type: "(^|[ \\t])+\\b([a-zA-Z0-9-]+\\.?)+(/[a-zA-Z0-9-_\\.]+)*\\b" |
| 9 |
|
| 10 |
# Keywords |
| 11 |
- special: "(^|[ \\t])+\\b(module|go)\\b" |
| 12 |
- preproc: "(^|[ \\t])+\\b(toolchain|require|exclude|replace|retract)\\b" |
| 13 |
- symbol.operator: "=>" |
| 14 |
|
| 15 |
# Brackets |
| 16 |
- type: "(\\(|\\))" |
| 17 |
|
| 18 |
# Go version |
| 19 |
- type: "(^|[ \\t])+([0-9]+\\.?)+" |
| 20 |
|
| 21 |
# Version |
| 22 |
- constant.string: "(^|[ \\t])+v([0-9]+\\.?){3}.*" |
| 23 |
- constant.number: "(^|[ \\t])+v([0-9]+\\.?){3}" |
| 24 |
|
| 25 |
- comment: |
| 26 |
start: "//" |
| 27 |
end: "$" |
| 28 |
rules: |
| 29 |
- todo: "(indirect):?" |
| 30 |
|
| 31 |
# (^|[ \\t])+ means after start of string or space or tab character |