package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type PageBlockClassArray []PageBlockClass
func (s PageBlockClassArray ) Sort (less func (a , b PageBlockClass ) bool ) PageBlockClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockClassArray ) SortStable (less func (a , b PageBlockClass ) bool ) PageBlockClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockClassArray ) Retain (keep func (x PageBlockClass ) bool ) PageBlockClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockClassArray ) First () (v PageBlockClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockClassArray ) Last () (v PageBlockClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockClassArray ) PopFirst () (v PageBlockClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockClassArray ) Pop () (v PageBlockClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s PageBlockClassArray ) AsPageBlockTitle () (to PageBlockTitleArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockTitle )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockSubtitle () (to PageBlockSubtitleArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockSubtitle )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockAuthorDate () (to PageBlockAuthorDateArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockAuthorDate )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockHeader () (to PageBlockHeaderArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockHeader )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockSubheader () (to PageBlockSubheaderArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockSubheader )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockParagraph () (to PageBlockParagraphArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockParagraph )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockPreformatted () (to PageBlockPreformattedArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockPreformatted )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockFooter () (to PageBlockFooterArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockFooter )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockAnchor () (to PageBlockAnchorArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockAnchor )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockList () (to PageBlockListArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockList )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockBlockquote () (to PageBlockBlockquoteArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockBlockquote )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockPullquote () (to PageBlockPullquoteArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockPullquote )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockPhoto () (to PageBlockPhotoArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockPhoto )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockVideo () (to PageBlockVideoArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockVideo )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockCover () (to PageBlockCoverArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockCover )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockEmbed () (to PageBlockEmbedArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockEmbed )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockEmbedPost () (to PageBlockEmbedPostArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockEmbedPost )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockCollage () (to PageBlockCollageArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockCollage )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockSlideshow () (to PageBlockSlideshowArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockSlideshow )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockChannel () (to PageBlockChannelArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockChannel )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockAudio () (to PageBlockAudioArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockAudio )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockKicker () (to PageBlockKickerArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockKicker )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockTable () (to PageBlockTableArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockTable )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockOrderedList () (to PageBlockOrderedListArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockOrderedList )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockDetails () (to PageBlockDetailsArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockDetails )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockRelatedArticles () (to PageBlockRelatedArticlesArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockRelatedArticles )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s PageBlockClassArray ) AsPageBlockMap () (to PageBlockMapArray ) {
for _ , elem := range s {
value , ok := elem .(*PageBlockMap )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type PageBlockTitleArray []PageBlockTitle
func (s PageBlockTitleArray ) Sort (less func (a , b PageBlockTitle ) bool ) PageBlockTitleArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockTitleArray ) SortStable (less func (a , b PageBlockTitle ) bool ) PageBlockTitleArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockTitleArray ) Retain (keep func (x PageBlockTitle ) bool ) PageBlockTitleArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockTitleArray ) First () (v PageBlockTitle , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockTitleArray ) Last () (v PageBlockTitle , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockTitleArray ) PopFirst () (v PageBlockTitle , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockTitle
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockTitleArray ) Pop () (v PageBlockTitle , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockSubtitleArray []PageBlockSubtitle
func (s PageBlockSubtitleArray ) Sort (less func (a , b PageBlockSubtitle ) bool ) PageBlockSubtitleArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockSubtitleArray ) SortStable (less func (a , b PageBlockSubtitle ) bool ) PageBlockSubtitleArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockSubtitleArray ) Retain (keep func (x PageBlockSubtitle ) bool ) PageBlockSubtitleArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockSubtitleArray ) First () (v PageBlockSubtitle , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockSubtitleArray ) Last () (v PageBlockSubtitle , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockSubtitleArray ) PopFirst () (v PageBlockSubtitle , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockSubtitle
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockSubtitleArray ) Pop () (v PageBlockSubtitle , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockAuthorDateArray []PageBlockAuthorDate
func (s PageBlockAuthorDateArray ) Sort (less func (a , b PageBlockAuthorDate ) bool ) PageBlockAuthorDateArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockAuthorDateArray ) SortStable (less func (a , b PageBlockAuthorDate ) bool ) PageBlockAuthorDateArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockAuthorDateArray ) Retain (keep func (x PageBlockAuthorDate ) bool ) PageBlockAuthorDateArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockAuthorDateArray ) First () (v PageBlockAuthorDate , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockAuthorDateArray ) Last () (v PageBlockAuthorDate , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockAuthorDateArray ) PopFirst () (v PageBlockAuthorDate , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockAuthorDate
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockAuthorDateArray ) Pop () (v PageBlockAuthorDate , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockHeaderArray []PageBlockHeader
func (s PageBlockHeaderArray ) Sort (less func (a , b PageBlockHeader ) bool ) PageBlockHeaderArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockHeaderArray ) SortStable (less func (a , b PageBlockHeader ) bool ) PageBlockHeaderArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockHeaderArray ) Retain (keep func (x PageBlockHeader ) bool ) PageBlockHeaderArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockHeaderArray ) First () (v PageBlockHeader , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockHeaderArray ) Last () (v PageBlockHeader , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockHeaderArray ) PopFirst () (v PageBlockHeader , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockHeader
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockHeaderArray ) Pop () (v PageBlockHeader , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockSubheaderArray []PageBlockSubheader
func (s PageBlockSubheaderArray ) Sort (less func (a , b PageBlockSubheader ) bool ) PageBlockSubheaderArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockSubheaderArray ) SortStable (less func (a , b PageBlockSubheader ) bool ) PageBlockSubheaderArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockSubheaderArray ) Retain (keep func (x PageBlockSubheader ) bool ) PageBlockSubheaderArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockSubheaderArray ) First () (v PageBlockSubheader , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockSubheaderArray ) Last () (v PageBlockSubheader , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockSubheaderArray ) PopFirst () (v PageBlockSubheader , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockSubheader
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockSubheaderArray ) Pop () (v PageBlockSubheader , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockParagraphArray []PageBlockParagraph
func (s PageBlockParagraphArray ) Sort (less func (a , b PageBlockParagraph ) bool ) PageBlockParagraphArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockParagraphArray ) SortStable (less func (a , b PageBlockParagraph ) bool ) PageBlockParagraphArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockParagraphArray ) Retain (keep func (x PageBlockParagraph ) bool ) PageBlockParagraphArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockParagraphArray ) First () (v PageBlockParagraph , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockParagraphArray ) Last () (v PageBlockParagraph , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockParagraphArray ) PopFirst () (v PageBlockParagraph , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockParagraph
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockParagraphArray ) Pop () (v PageBlockParagraph , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockPreformattedArray []PageBlockPreformatted
func (s PageBlockPreformattedArray ) Sort (less func (a , b PageBlockPreformatted ) bool ) PageBlockPreformattedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockPreformattedArray ) SortStable (less func (a , b PageBlockPreformatted ) bool ) PageBlockPreformattedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockPreformattedArray ) Retain (keep func (x PageBlockPreformatted ) bool ) PageBlockPreformattedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockPreformattedArray ) First () (v PageBlockPreformatted , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockPreformattedArray ) Last () (v PageBlockPreformatted , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockPreformattedArray ) PopFirst () (v PageBlockPreformatted , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockPreformatted
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockPreformattedArray ) Pop () (v PageBlockPreformatted , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockFooterArray []PageBlockFooter
func (s PageBlockFooterArray ) Sort (less func (a , b PageBlockFooter ) bool ) PageBlockFooterArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockFooterArray ) SortStable (less func (a , b PageBlockFooter ) bool ) PageBlockFooterArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockFooterArray ) Retain (keep func (x PageBlockFooter ) bool ) PageBlockFooterArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockFooterArray ) First () (v PageBlockFooter , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockFooterArray ) Last () (v PageBlockFooter , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockFooterArray ) PopFirst () (v PageBlockFooter , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockFooter
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockFooterArray ) Pop () (v PageBlockFooter , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockAnchorArray []PageBlockAnchor
func (s PageBlockAnchorArray ) Sort (less func (a , b PageBlockAnchor ) bool ) PageBlockAnchorArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockAnchorArray ) SortStable (less func (a , b PageBlockAnchor ) bool ) PageBlockAnchorArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockAnchorArray ) Retain (keep func (x PageBlockAnchor ) bool ) PageBlockAnchorArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockAnchorArray ) First () (v PageBlockAnchor , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockAnchorArray ) Last () (v PageBlockAnchor , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockAnchorArray ) PopFirst () (v PageBlockAnchor , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockAnchor
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockAnchorArray ) Pop () (v PageBlockAnchor , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockListArray []PageBlockList
func (s PageBlockListArray ) Sort (less func (a , b PageBlockList ) bool ) PageBlockListArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockListArray ) SortStable (less func (a , b PageBlockList ) bool ) PageBlockListArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockListArray ) Retain (keep func (x PageBlockList ) bool ) PageBlockListArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockListArray ) First () (v PageBlockList , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockListArray ) Last () (v PageBlockList , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockListArray ) PopFirst () (v PageBlockList , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockList
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockListArray ) Pop () (v PageBlockList , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockBlockquoteArray []PageBlockBlockquote
func (s PageBlockBlockquoteArray ) Sort (less func (a , b PageBlockBlockquote ) bool ) PageBlockBlockquoteArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockBlockquoteArray ) SortStable (less func (a , b PageBlockBlockquote ) bool ) PageBlockBlockquoteArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockBlockquoteArray ) Retain (keep func (x PageBlockBlockquote ) bool ) PageBlockBlockquoteArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockBlockquoteArray ) First () (v PageBlockBlockquote , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockBlockquoteArray ) Last () (v PageBlockBlockquote , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockBlockquoteArray ) PopFirst () (v PageBlockBlockquote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockBlockquote
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockBlockquoteArray ) Pop () (v PageBlockBlockquote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockPullquoteArray []PageBlockPullquote
func (s PageBlockPullquoteArray ) Sort (less func (a , b PageBlockPullquote ) bool ) PageBlockPullquoteArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockPullquoteArray ) SortStable (less func (a , b PageBlockPullquote ) bool ) PageBlockPullquoteArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockPullquoteArray ) Retain (keep func (x PageBlockPullquote ) bool ) PageBlockPullquoteArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockPullquoteArray ) First () (v PageBlockPullquote , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockPullquoteArray ) Last () (v PageBlockPullquote , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockPullquoteArray ) PopFirst () (v PageBlockPullquote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockPullquote
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockPullquoteArray ) Pop () (v PageBlockPullquote , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockPhotoArray []PageBlockPhoto
func (s PageBlockPhotoArray ) Sort (less func (a , b PageBlockPhoto ) bool ) PageBlockPhotoArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockPhotoArray ) SortStable (less func (a , b PageBlockPhoto ) bool ) PageBlockPhotoArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockPhotoArray ) Retain (keep func (x PageBlockPhoto ) bool ) PageBlockPhotoArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockPhotoArray ) First () (v PageBlockPhoto , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockPhotoArray ) Last () (v PageBlockPhoto , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockPhotoArray ) PopFirst () (v PageBlockPhoto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockPhoto
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockPhotoArray ) Pop () (v PageBlockPhoto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockVideoArray []PageBlockVideo
func (s PageBlockVideoArray ) Sort (less func (a , b PageBlockVideo ) bool ) PageBlockVideoArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockVideoArray ) SortStable (less func (a , b PageBlockVideo ) bool ) PageBlockVideoArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockVideoArray ) Retain (keep func (x PageBlockVideo ) bool ) PageBlockVideoArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockVideoArray ) First () (v PageBlockVideo , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockVideoArray ) Last () (v PageBlockVideo , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockVideoArray ) PopFirst () (v PageBlockVideo , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockVideo
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockVideoArray ) Pop () (v PageBlockVideo , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockCoverArray []PageBlockCover
func (s PageBlockCoverArray ) Sort (less func (a , b PageBlockCover ) bool ) PageBlockCoverArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockCoverArray ) SortStable (less func (a , b PageBlockCover ) bool ) PageBlockCoverArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockCoverArray ) Retain (keep func (x PageBlockCover ) bool ) PageBlockCoverArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockCoverArray ) First () (v PageBlockCover , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockCoverArray ) Last () (v PageBlockCover , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockCoverArray ) PopFirst () (v PageBlockCover , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockCover
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockCoverArray ) Pop () (v PageBlockCover , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockEmbedArray []PageBlockEmbed
func (s PageBlockEmbedArray ) Sort (less func (a , b PageBlockEmbed ) bool ) PageBlockEmbedArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockEmbedArray ) SortStable (less func (a , b PageBlockEmbed ) bool ) PageBlockEmbedArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockEmbedArray ) Retain (keep func (x PageBlockEmbed ) bool ) PageBlockEmbedArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockEmbedArray ) First () (v PageBlockEmbed , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockEmbedArray ) Last () (v PageBlockEmbed , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockEmbedArray ) PopFirst () (v PageBlockEmbed , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockEmbed
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockEmbedArray ) Pop () (v PageBlockEmbed , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockEmbedPostArray []PageBlockEmbedPost
func (s PageBlockEmbedPostArray ) Sort (less func (a , b PageBlockEmbedPost ) bool ) PageBlockEmbedPostArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockEmbedPostArray ) SortStable (less func (a , b PageBlockEmbedPost ) bool ) PageBlockEmbedPostArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockEmbedPostArray ) Retain (keep func (x PageBlockEmbedPost ) bool ) PageBlockEmbedPostArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockEmbedPostArray ) First () (v PageBlockEmbedPost , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockEmbedPostArray ) Last () (v PageBlockEmbedPost , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockEmbedPostArray ) PopFirst () (v PageBlockEmbedPost , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockEmbedPost
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockEmbedPostArray ) Pop () (v PageBlockEmbedPost , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s PageBlockEmbedPostArray ) SortByDate () PageBlockEmbedPostArray {
return s .Sort (func (a , b PageBlockEmbedPost ) bool {
return a .GetDate () < b .GetDate ()
})
}
func (s PageBlockEmbedPostArray ) SortStableByDate () PageBlockEmbedPostArray {
return s .SortStable (func (a , b PageBlockEmbedPost ) bool {
return a .GetDate () < b .GetDate ()
})
}
type PageBlockCollageArray []PageBlockCollage
func (s PageBlockCollageArray ) Sort (less func (a , b PageBlockCollage ) bool ) PageBlockCollageArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockCollageArray ) SortStable (less func (a , b PageBlockCollage ) bool ) PageBlockCollageArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockCollageArray ) Retain (keep func (x PageBlockCollage ) bool ) PageBlockCollageArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockCollageArray ) First () (v PageBlockCollage , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockCollageArray ) Last () (v PageBlockCollage , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockCollageArray ) PopFirst () (v PageBlockCollage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockCollage
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockCollageArray ) Pop () (v PageBlockCollage , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockSlideshowArray []PageBlockSlideshow
func (s PageBlockSlideshowArray ) Sort (less func (a , b PageBlockSlideshow ) bool ) PageBlockSlideshowArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockSlideshowArray ) SortStable (less func (a , b PageBlockSlideshow ) bool ) PageBlockSlideshowArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockSlideshowArray ) Retain (keep func (x PageBlockSlideshow ) bool ) PageBlockSlideshowArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockSlideshowArray ) First () (v PageBlockSlideshow , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockSlideshowArray ) Last () (v PageBlockSlideshow , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockSlideshowArray ) PopFirst () (v PageBlockSlideshow , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockSlideshow
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockSlideshowArray ) Pop () (v PageBlockSlideshow , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockChannelArray []PageBlockChannel
func (s PageBlockChannelArray ) Sort (less func (a , b PageBlockChannel ) bool ) PageBlockChannelArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockChannelArray ) SortStable (less func (a , b PageBlockChannel ) bool ) PageBlockChannelArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockChannelArray ) Retain (keep func (x PageBlockChannel ) bool ) PageBlockChannelArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockChannelArray ) First () (v PageBlockChannel , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockChannelArray ) Last () (v PageBlockChannel , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockChannelArray ) PopFirst () (v PageBlockChannel , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockChannel
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockChannelArray ) Pop () (v PageBlockChannel , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockAudioArray []PageBlockAudio
func (s PageBlockAudioArray ) Sort (less func (a , b PageBlockAudio ) bool ) PageBlockAudioArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockAudioArray ) SortStable (less func (a , b PageBlockAudio ) bool ) PageBlockAudioArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockAudioArray ) Retain (keep func (x PageBlockAudio ) bool ) PageBlockAudioArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockAudioArray ) First () (v PageBlockAudio , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockAudioArray ) Last () (v PageBlockAudio , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockAudioArray ) PopFirst () (v PageBlockAudio , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockAudio
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockAudioArray ) Pop () (v PageBlockAudio , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockKickerArray []PageBlockKicker
func (s PageBlockKickerArray ) Sort (less func (a , b PageBlockKicker ) bool ) PageBlockKickerArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockKickerArray ) SortStable (less func (a , b PageBlockKicker ) bool ) PageBlockKickerArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockKickerArray ) Retain (keep func (x PageBlockKicker ) bool ) PageBlockKickerArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockKickerArray ) First () (v PageBlockKicker , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockKickerArray ) Last () (v PageBlockKicker , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockKickerArray ) PopFirst () (v PageBlockKicker , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockKicker
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockKickerArray ) Pop () (v PageBlockKicker , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockTableArray []PageBlockTable
func (s PageBlockTableArray ) Sort (less func (a , b PageBlockTable ) bool ) PageBlockTableArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockTableArray ) SortStable (less func (a , b PageBlockTable ) bool ) PageBlockTableArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockTableArray ) Retain (keep func (x PageBlockTable ) bool ) PageBlockTableArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockTableArray ) First () (v PageBlockTable , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockTableArray ) Last () (v PageBlockTable , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockTableArray ) PopFirst () (v PageBlockTable , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockTable
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockTableArray ) Pop () (v PageBlockTable , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockOrderedListArray []PageBlockOrderedList
func (s PageBlockOrderedListArray ) Sort (less func (a , b PageBlockOrderedList ) bool ) PageBlockOrderedListArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockOrderedListArray ) SortStable (less func (a , b PageBlockOrderedList ) bool ) PageBlockOrderedListArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockOrderedListArray ) Retain (keep func (x PageBlockOrderedList ) bool ) PageBlockOrderedListArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockOrderedListArray ) First () (v PageBlockOrderedList , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockOrderedListArray ) Last () (v PageBlockOrderedList , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockOrderedListArray ) PopFirst () (v PageBlockOrderedList , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockOrderedList
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockOrderedListArray ) Pop () (v PageBlockOrderedList , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockDetailsArray []PageBlockDetails
func (s PageBlockDetailsArray ) Sort (less func (a , b PageBlockDetails ) bool ) PageBlockDetailsArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockDetailsArray ) SortStable (less func (a , b PageBlockDetails ) bool ) PageBlockDetailsArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockDetailsArray ) Retain (keep func (x PageBlockDetails ) bool ) PageBlockDetailsArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockDetailsArray ) First () (v PageBlockDetails , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockDetailsArray ) Last () (v PageBlockDetails , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockDetailsArray ) PopFirst () (v PageBlockDetails , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockDetails
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockDetailsArray ) Pop () (v PageBlockDetails , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockRelatedArticlesArray []PageBlockRelatedArticles
func (s PageBlockRelatedArticlesArray ) Sort (less func (a , b PageBlockRelatedArticles ) bool ) PageBlockRelatedArticlesArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockRelatedArticlesArray ) SortStable (less func (a , b PageBlockRelatedArticles ) bool ) PageBlockRelatedArticlesArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockRelatedArticlesArray ) Retain (keep func (x PageBlockRelatedArticles ) bool ) PageBlockRelatedArticlesArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockRelatedArticlesArray ) First () (v PageBlockRelatedArticles , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockRelatedArticlesArray ) Last () (v PageBlockRelatedArticles , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockRelatedArticlesArray ) PopFirst () (v PageBlockRelatedArticles , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockRelatedArticles
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockRelatedArticlesArray ) Pop () (v PageBlockRelatedArticles , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
type PageBlockMapArray []PageBlockMap
func (s PageBlockMapArray ) Sort (less func (a , b PageBlockMap ) bool ) PageBlockMapArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockMapArray ) SortStable (less func (a , b PageBlockMap ) bool ) PageBlockMapArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s PageBlockMapArray ) Retain (keep func (x PageBlockMap ) bool ) PageBlockMapArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s PageBlockMapArray ) First () (v PageBlockMap , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s PageBlockMapArray ) Last () (v PageBlockMap , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *PageBlockMapArray ) PopFirst () (v PageBlockMap , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero PageBlockMap
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *PageBlockMapArray ) Pop () (v PageBlockMap , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [len (a )-1 ]
a = a [:len (a )-1 ]
*s = a
return v , true
}
The pages are generated with Golds v0.6.7 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds .