diff options
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/state/join.go (renamed from internal/state/util.go) | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/state/util.go b/internal/state/join.go index 473ae51d..2b4011fe 100644 --- a/internal/state/util.go +++ b/internal/state/join.go @@ -9,8 +9,19 @@ var ( ErrDuplicate = errors.New("store contains duplicates") ) +/* +Joiner is the interface that wraps the Join method. + +The Join function uses Joiner if available. +*/ +type Joiner interface{ Join() (Entries, error) } + // Join returns joined state entries of all active aids. func Join(s Store) (Entries, error) { + if j, ok := s.(Joiner); ok { + return j.Join() + } + var ( aids []int entries = make(Entries) |
