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 StickerSetCoveredClassArray []StickerSetCoveredClass
func (s StickerSetCoveredClassArray ) Sort (less func (a , b StickerSetCoveredClass ) bool ) StickerSetCoveredClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetCoveredClassArray ) SortStable (less func (a , b StickerSetCoveredClass ) bool ) StickerSetCoveredClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetCoveredClassArray ) Retain (keep func (x StickerSetCoveredClass ) bool ) StickerSetCoveredClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s StickerSetCoveredClassArray ) First () (v StickerSetCoveredClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s StickerSetCoveredClassArray ) Last () (v StickerSetCoveredClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *StickerSetCoveredClassArray ) PopFirst () (v StickerSetCoveredClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero StickerSetCoveredClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *StickerSetCoveredClassArray ) Pop () (v StickerSetCoveredClass , 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 StickerSetCoveredClassArray ) AsStickerSetCovered () (to StickerSetCoveredArray ) {
for _ , elem := range s {
value , ok := elem .(*StickerSetCovered )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s StickerSetCoveredClassArray ) AsStickerSetMultiCovered () (to StickerSetMultiCoveredArray ) {
for _ , elem := range s {
value , ok := elem .(*StickerSetMultiCovered )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s StickerSetCoveredClassArray ) AsStickerSetFullCovered () (to StickerSetFullCoveredArray ) {
for _ , elem := range s {
value , ok := elem .(*StickerSetFullCovered )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s StickerSetCoveredClassArray ) AsStickerSetNoCovered () (to StickerSetNoCoveredArray ) {
for _ , elem := range s {
value , ok := elem .(*StickerSetNoCovered )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type StickerSetCoveredArray []StickerSetCovered
func (s StickerSetCoveredArray ) Sort (less func (a , b StickerSetCovered ) bool ) StickerSetCoveredArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetCoveredArray ) SortStable (less func (a , b StickerSetCovered ) bool ) StickerSetCoveredArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetCoveredArray ) Retain (keep func (x StickerSetCovered ) bool ) StickerSetCoveredArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s StickerSetCoveredArray ) First () (v StickerSetCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s StickerSetCoveredArray ) Last () (v StickerSetCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *StickerSetCoveredArray ) PopFirst () (v StickerSetCovered , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero StickerSetCovered
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *StickerSetCoveredArray ) Pop () (v StickerSetCovered , 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 StickerSetMultiCoveredArray []StickerSetMultiCovered
func (s StickerSetMultiCoveredArray ) Sort (less func (a , b StickerSetMultiCovered ) bool ) StickerSetMultiCoveredArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetMultiCoveredArray ) SortStable (less func (a , b StickerSetMultiCovered ) bool ) StickerSetMultiCoveredArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetMultiCoveredArray ) Retain (keep func (x StickerSetMultiCovered ) bool ) StickerSetMultiCoveredArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s StickerSetMultiCoveredArray ) First () (v StickerSetMultiCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s StickerSetMultiCoveredArray ) Last () (v StickerSetMultiCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *StickerSetMultiCoveredArray ) PopFirst () (v StickerSetMultiCovered , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero StickerSetMultiCovered
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *StickerSetMultiCoveredArray ) Pop () (v StickerSetMultiCovered , 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 StickerSetFullCoveredArray []StickerSetFullCovered
func (s StickerSetFullCoveredArray ) Sort (less func (a , b StickerSetFullCovered ) bool ) StickerSetFullCoveredArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetFullCoveredArray ) SortStable (less func (a , b StickerSetFullCovered ) bool ) StickerSetFullCoveredArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetFullCoveredArray ) Retain (keep func (x StickerSetFullCovered ) bool ) StickerSetFullCoveredArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s StickerSetFullCoveredArray ) First () (v StickerSetFullCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s StickerSetFullCoveredArray ) Last () (v StickerSetFullCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *StickerSetFullCoveredArray ) PopFirst () (v StickerSetFullCovered , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero StickerSetFullCovered
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *StickerSetFullCoveredArray ) Pop () (v StickerSetFullCovered , 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 StickerSetNoCoveredArray []StickerSetNoCovered
func (s StickerSetNoCoveredArray ) Sort (less func (a , b StickerSetNoCovered ) bool ) StickerSetNoCoveredArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetNoCoveredArray ) SortStable (less func (a , b StickerSetNoCovered ) bool ) StickerSetNoCoveredArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s StickerSetNoCoveredArray ) Retain (keep func (x StickerSetNoCovered ) bool ) StickerSetNoCoveredArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s StickerSetNoCoveredArray ) First () (v StickerSetNoCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s StickerSetNoCoveredArray ) Last () (v StickerSetNoCovered , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *StickerSetNoCoveredArray ) PopFirst () (v StickerSetNoCovered , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero StickerSetNoCovered
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *StickerSetNoCoveredArray ) Pop () (v StickerSetNoCovered , 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 .