Skip to content

E0118: Static initialization cycle ​

Statics are initialized in dependency order. These depend on each other (directly, or through the functions and methods their values call), so no order works.

Wrong ​

vuka
type Post struct {
	static A = Post.B + 1
	static B = Post.A * 2
}
vuka
type Post struct {
	static A = 1
	static B = Post.A * 2
}

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.