oh-my-posh/segment_golang.go

25 lines
486 B
Go
Raw Normal View History

2020-10-22 04:47:42 -07:00
package main
type golang struct {
2020-11-14 11:04:04 -08:00
language *language
2020-10-22 04:47:42 -07:00
}
func (g *golang) string() string {
2020-11-14 11:04:04 -08:00
return g.language.string()
2020-10-22 04:47:42 -07:00
}
func (g *golang) init(props *properties, env environmentInfo) {
2020-11-14 11:04:04 -08:00
g.language = &language{
env: env,
props: props,
commands: []string{"go"},
versionParam: "version",
extensions: []string{"*.go", "go.mod"},
2020-11-14 11:04:04 -08:00
versionRegex: `go(?P<version>[0-9]+.[0-9]+.[0-9]+)`,
}
2020-10-22 04:47:42 -07:00
}
func (g *golang) enabled() bool {
2020-11-14 11:04:04 -08:00
return g.language.enabled()
2020-10-22 04:47:42 -07:00
}