mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 19:39:39 -08:00
de498044c9
resolves #428
30 lines
620 B
Go
30 lines
620 B
Go
package main
|
|
|
|
type golang struct {
|
|
language *language
|
|
}
|
|
|
|
func (g *golang) string() string {
|
|
return g.language.string()
|
|
}
|
|
|
|
func (g *golang) init(props *properties, env environmentInfo) {
|
|
g.language = &language{
|
|
env: env,
|
|
props: props,
|
|
extensions: []string{"*.go", "go.mod"},
|
|
commands: []*cmd{
|
|
{
|
|
executable: "go",
|
|
args: []string{"version"},
|
|
regex: `(?:go(?P<version>((?P<major>[0-9]+).(?P<minor>[0-9]+)(.(?P<patch>[0-9]+))?)))`,
|
|
},
|
|
},
|
|
versionURLTemplate: "[%s](https://golang.org/doc/go%s.%s)",
|
|
}
|
|
}
|
|
|
|
func (g *golang) enabled() bool {
|
|
return g.language.enabled()
|
|
}
|