Just do
func Modifier(ptr *Struct, ptrInt *int) int { ptr.a++ ptr.b++ *ptrInt++ return ptr.a + ptr.b + *ptrInt }
In fact, you tried to use ++ on *(ptr.a) , and ptr.a is an int, not a pointer to an int.
You could use (*ptr).a++ , but this is not necessary since Go will automatically ptr.a if ptr is a pointer, so you don't have -> in Go.
Denys seguret
source share