I wanted to ask the opinion of people here. If you had a data structure
type A struct {
Id string
Name string
Source string
}
and based on the Source value you needed to connect to one of two different
services to resolve a float64 based on a *time.Time, where the two services
had APIs such that one only allowed for a single A to be resolved at a time
while another took a sequence of A, do you think you would be more inclined
to
(a) create a functions for each service lookup type, e.g.,
resolveServiceType1(a A, t *time.Time) float64
resolveServiceType2(a []A, t *time.Time) []float64
(b) create functions to operate on a struct Set []A that could resolve a
slice of a Set as needed?
type Set []A
func (set Set) Resolve(t *time.T) []float64
under the hood this Resolve function would have to examine the A.Source to
determine whether or not it had to make many resolver calls or could batch
them into one
(c) create something more elaborate?
Jim
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.