Skip to content

cmd/go: missing position for "unknown godebug" error from go list #67623

Closed
@findleyr

Description

@findleyr

go list reports an error for unknown godebug values. But this error lacks a position:

$ cat go.mod
module example.com/m

go 1.23

godebug foo=1
$ go list .
go: .: unknown godebug "foo"

Compare with the message when there's a syntax error:

> go list .
go: errors parsing go.mod:
go.mod:5: unknown directive: godebg

As a result, gopls does not position this error correctly.

The go command should also position the error correctly in go.work files.

CC @rsc @matloob

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions