mozey
mozey

Reputation: 2292

What is the difference between "(type func())" and "type func()"

I'm trying to build a code example and I get the following error:

cannot use FuncName (type func()) as type func() error in field value

What does the wrapping parenthesis mean?

Upvotes: 1

Views: 113

Answers (1)

Ainar-G
Ainar-G

Reputation: 36199

There is no difference but you're misinterpreting the error message. What it's saying is that type FuncName which is func() cannot be used as func() error because it doesn't return an error.

Upvotes: 7

Related Questions