package com

func SkipLimitToStartEnd(skip, limit int32, maxLimit int) (start int32, end int32) {
	if skip < 0 {
		skip = 0
	}
	if limit < 1 {
		limit = 10
	}

	start = skip
	end = skip + limit
	if end >= int32(maxLimit) {
		end = int32(maxLimit)
		if start > end {
			start = end
		}
	}
	return
}
