From df724f5827e2b96d53a708d642ee52798506915c Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 12 Oct 2024 10:33:24 +0200 Subject: loader: don't panic when main package is not named 'main' This can in fact happen in practice, so return an actual error message instead. --- testdata/errors/invalidmain.go | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 testdata/errors/invalidmain.go (limited to 'testdata/errors') diff --git a/testdata/errors/invalidmain.go b/testdata/errors/invalidmain.go new file mode 100644 index 000000000..a86e32c8d --- /dev/null +++ b/testdata/errors/invalidmain.go @@ -0,0 +1,6 @@ +// some comment to move the first line + +package foobar + +// ERROR: # command-line-arguments +// ERROR: invalidmain.go:3:9: expected main package to have name "main", not "foobar" -- cgit v1.2.3