@ -17,54 +17,72 @@ go 1.15
-- main.go --
-- main.go --
package main
package main
var exploded []byte
// chungus is filled by ordered init funcs, all in a single file.
// If we change the relative order of init funcs within a file, this file will break.
var chungus []byte
func init() { chungus = append(chungus, 'B') }
func init() { chungus = append(chungus, 'i') }
func init() { chungus = append(chungus, 'g') }
func init() { chungus = append(chungus, ' ') }
func init() { chungus = append(chungus, 'C') }
func init() { chungus = append(chungus, 'h') }
func init() { chungus = append(chungus, 'u') }
func init() { chungus = append(chungus, 'n') }
func init() { chungus = append(chungus, 'g') }
func init() { chungus = append(chungus, 'u') }
func init() { chungus = append(chungus, 's') }
func init() {
func main() {
exploded = append(exploded, 'B')
println(string(chungus))
println(string(yoshi))
}
}
-- y.go --
package main
func init() {
// yoshi is filled by ordered init funcs, all in different files.
exploded = append(exploded, 'i')
// If we change the relative order of filenames when sorted, this file will break.
}
var yoshi []byte
-- y0.go --
package main
func init() {
func init() { yoshi = append(yoshi, 'B') }
exploded = append(exploded, 'g')
-- y1.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'E') }
exploded = append(exploded, ' ')
-- y2.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'E') }
exploded = append(exploded, 'C')
-- y3.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'G') }
exploded = append(exploded, 'h')
-- y4.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, ' ') }
exploded = append(exploded, 'u')
-- y5.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'Y') }
exploded = append(exploded, 'n')
-- y6.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'O') }
exploded = append(exploded, 'g')
-- y7.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'S') }
exploded = append(exploded, 'u')
-- y8.go --
}
package main
func init() {
func init() { yoshi = append(yoshi, 'H') }
exploded = append(exploded, 's')
-- y9.go --
}
package main
func main() {
func init() { yoshi = append(yoshi, 'I') }
println(string(exploded))
}
-- main.stderr --
-- main.stderr --
Big Chungus
Big Chungus
BEEG YOSHI