by Groxx · 3w ago · 0 comments
Otherwise agreed, methods like this can be mutable in any language that doesn't heavily specialize primitives.
(You obviously know this, but it might be a surprise to many people reading this thread.)
package main
import "fmt"
type T int32
func (t *T) inc() { *t = *t + 1 }
func main() {
var t T = 42
t.inc()
fmt.Println(t)
}