Skip to content

Commit 6c2d708

Browse files
NotAFlightRiskJanDeDobbeleer
authored andcommitted
fix(golang): read the documented parse_go_work_file option
1 parent 81ffba2 commit 6c2d708

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/segments/golang.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ type Golang struct {
1212
}
1313

1414
const (
15-
ParseModFile options.Option = "parse_mod_file"
16-
ParseWorkFile options.Option = "parse_work_file"
15+
ParseModFile options.Option = "parse_mod_file"
16+
ParseGoWorkFile options.Option = "parse_go_work_file"
1717
)
1818

1919
func (g *Golang) Template() string {
@@ -44,7 +44,7 @@ func (g *Golang) getVersion() (string, error) {
4444
return g.parseModFile()
4545
}
4646

47-
if g.options.Bool(ParseWorkFile, false) {
47+
if g.options.Bool(ParseGoWorkFile, false) {
4848
return g.parseWorkFile()
4949
}
5050

src/segments/golang_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestGolang(t *testing.T) {
9494
}
9595

9696
if tc.ParseGoWorkFile {
97-
props[ParseWorkFile] = tc.ParseGoWorkFile
97+
props[ParseGoWorkFile] = true
9898
fileInfo := &runtime.FileInfo{
9999
Path: "../test/go.work",
100100
ParentFolder: "./",

0 commit comments

Comments
 (0)