InvalidInitDecl occurs when init is declared as anything other than a function. Example: var init = 1 Example: func init() int { return 1 }