Function type explanation?

Can you give me full explanation about Function type?
type example func() int
for what is it used?

Did you take the Go tour? Take a look at

https://tour.golang.org/moretypes/24

1 Like

A simple example in the filepath library is the Walk() function (here) - which recursively visits each file and sub-directory from the given starting point. It then calls the WalkFunction that you implement to do some action on each file. Hope that gives you a more concrete use case!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.