Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: "cannot declare main" check erroneously applied to packages imported by main #24801

Closed
mdempsky opened this issue Apr 10, 2018 · 1 comment

Comments

@mdempsky
Copy link
Member

mdempsky commented Apr 10, 2018

$ cat a.go
package a

type main int

var X main

$ cat main.go
package main

import "./a"

func main() {
	a.X = 1
}

$ go tool compile a.go
$ go tool compile main.go
a.go:3: cannot declare main - must be func

This prevents github.com/juju/juju/cmd/juju from building with -l=4.

@gopherbot
Copy link

Change https://golang.org/cl/106120 mentions this issue: cmd/compile: fix check that ensure main.main is a function

@golang golang locked and limited conversation to collaborators Apr 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants