Skip to content

E0212: Decorated init ​

init takes no arguments and returns nothing, so the only decorator that fits it is a function of type func(func()) func().

Wrong ​

vuka
decorator logged(c) { c.Next() }

@logged
func init() {}
vuka
func once(f func()) func() { return f }

@once
func init() {}

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.