I'm trying to get goreturns to work on Windows 10 64bit with go 1.9.
If I run goreturns with -p parameter it displays following errors
main.go:4:2: could not import errors (Config.Importer not installed)
main.go: typechecking failed (continuing without type info)
package main
import (
"er
Here is modified example of Henry's vision to show you how to access Dog
struct in attack function https://play.golang.org/p/YJv1XTZWnA also another
solution by using encapsulation https://play.golang.org/p/ImW9cx5fQG
tiistai 31. tammikuuta 2017 14.51.42 UTC+2 jul.s...@gmail.com kirjoitti:
>
> H
Also it's probably better to use a pointer to Dog struct instead using it
as value type, then it works closer to a class
https://play.golang.org/p/_uS9D1i-8u . Example if you want to mutate Dog
struct by adding SetAge method.
On Tuesday, January 31, 2017 at 2:51:42 PM UTC+2, jul.s...@gmail.com
First link in my first reply didn't use encapsulation. It gave Dog as
parameter. Also not sure how golang internals work but when you encapsulate
something thats probably new heap allocation.
I know it's tempting to use OO patterns (classes) but golang has very powerful
interface system and I th