You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lib/types/page.go

15 lines
178 B
Go

package types
// Page 頁數
type Page struct {
Current, Size int
}
func (p Page) Take() int {
return p.Size
}
func (p Page) Skip() int {
return (p.Current - 1) * p.Size
}