From 35e81018e9bd183be7121b6b900dff3d49e234d5 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Fri, 20 Oct 2017 13:09:11 +0400 Subject: [PATCH] add MinIndex method to Group --- autofile/group.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/autofile/group.go b/autofile/group.go index 2c6aa610..d5797d08 100644 --- a/autofile/group.go +++ b/autofile/group.go @@ -146,6 +146,13 @@ func (g *Group) MaxIndex() int { return g.maxIndex } +// MinIndex returns index of the first file in the group. +func (g *Group) MinIndex() int { + g.mtx.Lock() + defer g.mtx.Unlock() + return g.minIndex +} + // Write writes the contents of p into the current head of the group. It // returns the number of bytes written. If nn < len(p), it also returns an // error explaining why the write is short.