1
0
mirror of https://github.com/golang/go synced 2024-11-21 14:44:40 -07:00
go/test/init.go
Gustavo Niemeyer daffc2d2ef gc: fix init of packages named main
This change removes the special case which existed
for handling the initalization of the main package,
so that other modules named 'main' get properly
initialized when imported.

Note that gotest of main packages will break in most
cases without this.

R=rsc
CC=golang-dev
https://golang.org/cl/4190050
2011-03-02 16:18:17 -05:00

19 lines
390 B
Go

// errchk $G -e $D/$F.go
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import "runtime"
func init() {
}
func main() {
init() // ERROR "undefined: init"
runtime.init() // ERROR "unexported.*runtime\.init"
var _ = init // ERROR "undefined: init"
}