Skip to content

E0202: Attribute in the wrong place ​

Attributes go in three places: before a top-level declaration, before a parameter of a top-level function, and after a field of a package-level struct. Not inside a function body, before a result or receiver, or in a function literal.

Wrong ​

vuka
func main() {
	@doc("the count")
	x := 1
}
vuka
@doc("the count")
var x = 1

func main() {}

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.