Beginner Go (Golang)
Q17 / 100

What is a pointer receiver vs value receiver?

Correct! Well done.

Incorrect.

The correct answer is B) Pointer receiver (*T) allows mutation and avoids copying; value receiver (T) gets a copy and cannot modify the original

B

Correct Answer

Pointer receiver (*T) allows mutation and avoids copying; value receiver (T) gets a copy and cannot modify the original

Explanation

Use *T receivers to modify the struct or avoid copying. Use T receivers when you only need read access and the struct is small.

Progress
17/100