Skip to content

Misleading error message #65788

@fukanchik

Description

@fukanchik

Go version

go version go1.18.1 linux/amd64

Output of go env in your module/workspace:

I think go env doesn't matter

What did you do?

Made a typo in a variable definition.

What did you see happen?

Misleading error message

./main.go:232:38: syntax error: unexpected status, expecting comma or )

At first I thought it was unexpected status within the compiler or somewhere else.

What did you expect to see?

A message similar to what, for example, gcc produces:

x.c:3:5: error: ‘status’ undeclared (first use in this function)

something like:

./main.go:232:38: syntax error: unexpected ‘status‘, expecting comma or )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions