After diving into the docs I couldn't find the answer to my following question:
Is there any reason against using this
for referring to the current object as in the following example?
type MyStruct struct {
someField string
}
func (this MyStruct) getSomeField() string {
return this.someField
}
The 6 Simple Machines are: wedge, screw, lever, wheel and axel, inclined plane and pulley.
A Rube Goldberg machine, named after American cartoonist Rube Goldberg, is a chain reaction-type machine or contraption intentionally designed to perform a simple task in an indirect and (impractically) overly complicated way.
The first day of filming included 47 takes, none of which successfully completed the entire machine and necessitated a second day of filming. Many of the takes ended only 30 seconds into the process, at the start of the song's chorus, where a tire would fail to roll properly into the next section of the machine.
Honda's "The Cog" is probably the best known Rube Goldberg machine.
There is no technical reason not to do this.
It does go against the general guidelines as explained here:
Don't use generic names such as "me", "this" or "self", identifiers typical of object-oriented languages that place more emphasis on methods as opposed to functions.
I would also like to add that in languages that use this
(or self
), this
is always a pointer. For method receivers in Go, this is not necessarily the case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With