How can I elegantly do it in go
?
In python I could use attribute like this:
def function():
function.counter += 1
function.counter = 0
Does go
have the same opportunity?
How can I elegantly do it in go
?
In python I could use attribute like this:
def function():
function.counter += 1
function.counter = 0
Does go
have the same opportunity?
var doThingCounter = 0
func DoThing() {
// Do the thing...
doThingCounter++
}