package helpers func Offset(page int, pageSize int) int { offset := (page - 1) * pageSize if offset < 0 { offset = 0 } return offset }