func (f *FixedSizeRingBuf) Last() int {
	if f.Readable == 0 {
		return -1
	}

	last := f.Beg + f.Readable - 1
	if last < f.N {
		// we fit without wrapping
		return last
	}

	return last % f.N
}
func (f *FixedSizeRingBuf) Last() int {
	if f.Readable == 0 {
		return -1
	}

	last := f.Beg + f.Readable - 1
	if last < f.N {
		
		return last
	}

	return last % f.N
}
func ( f * FixedSizeRingBuf ) Last ( ) int { if f . Readable == 0 { return - 1 } last := f . Beg + f . Readable - 1 if last < f . N { // we fit without wrapping return last } return last % f . N }
// Last returns the index of the last element,
// or -1 if the ring is empty.
Last returns the index of the last element or - 1 if the ring is empty .