What is better, having 3 methods to get different properties:
func (s *Something) GetSections() {
var sections []Section
// code to get sections and append to sections
}
func (s *Something) GetValues() {
var values []Value
// code to get values and append to values
}
func (s *Something) GetKeys() {
var keys []Key
// code to get keys and append to keys
}
Or one method that receives what should get:
func (s *Something) GetProperties(propertyName string) {
// code to get the desire property.
}
I'm talking here about the best practice involving creating a method to access the internal data of a struct.
I'm not sure if this is opinion based question, if it yes, I'm happy to delete it.