A function within a structure. Why?

Viewed 139

What is the use case/advantage of defining a function within a structure in go?

type demo struct {
    F func()
}
2 Answers
Related