DEV Community

Discussion on: Go's method is curried funtion

Collapse
 
plutov profile image
Alex Pliutau

I never saw Go people use Foo.doSomething(123) ... Can you point to some open source projects doing this?

Collapse
 
mattn profile image
Yasuhiro Matsumoto

Yes, most of cases, the function will not be called directly. As I wrote in above, it is often used as function object. See os/exec.go in Go repository.

runtime.SetFinalizer(p, (*Process).Release)