In Golang, I have below Struct with three fields
type Person struct {
name string
age int
rank int
}
For Processing, I need a rank field, but for output, I want to exclude the rank field from struct as I am directly passing above struct to JSON encoder to throw a response.
Is there any way by which I can unset rank field from Struct?