usually for stores like this I just do this:
type Store interface {
GetTask(*Task) error
}
instead of having "GetTaskByID" and "GetTaskByTag" and whatnot. Then in the caller you just do this: task := store.Task{ID: 5}
if err := db.GetTask(&task); err != nil {
// wahtever
}
^ that gets the task by ID task := store.Task{Tag: "foo"}
if err := db.GetTask(&task); err != nil {
// wahtever
}
^ that gets the task by tag.