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 InputBotInlineResultClassArray []InputBotInlineResultClass
func (s InputBotInlineResultClassArray ) Sort (less func (a , b InputBotInlineResultClass ) bool ) InputBotInlineResultClassArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultClassArray ) SortStable (less func (a , b InputBotInlineResultClass ) bool ) InputBotInlineResultClassArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultClassArray ) Retain (keep func (x InputBotInlineResultClass ) bool ) InputBotInlineResultClassArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineResultClassArray ) First () (v InputBotInlineResultClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineResultClassArray ) Last () (v InputBotInlineResultClass , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineResultClassArray ) PopFirst () (v InputBotInlineResultClass , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineResultClass
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineResultClassArray ) Pop () (v InputBotInlineResultClass , 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 InputBotInlineResultClassArray ) AsInputBotInlineResult () (to InputBotInlineResultArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineResult )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineResultClassArray ) AsInputBotInlineResultPhoto () (to InputBotInlineResultPhotoArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineResultPhoto )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineResultClassArray ) AsInputBotInlineResultDocument () (to InputBotInlineResultDocumentArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineResultDocument )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
func (s InputBotInlineResultClassArray ) AsInputBotInlineResultGame () (to InputBotInlineResultGameArray ) {
for _ , elem := range s {
value , ok := elem .(*InputBotInlineResultGame )
if !ok {
continue
}
to = append (to , *value )
}
return to
}
type InputBotInlineResultArray []InputBotInlineResult
func (s InputBotInlineResultArray ) Sort (less func (a , b InputBotInlineResult ) bool ) InputBotInlineResultArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultArray ) SortStable (less func (a , b InputBotInlineResult ) bool ) InputBotInlineResultArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultArray ) Retain (keep func (x InputBotInlineResult ) bool ) InputBotInlineResultArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineResultArray ) First () (v InputBotInlineResult , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineResultArray ) Last () (v InputBotInlineResult , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineResultArray ) PopFirst () (v InputBotInlineResult , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineResult
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineResultArray ) Pop () (v InputBotInlineResult , 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 InputBotInlineResultPhotoArray []InputBotInlineResultPhoto
func (s InputBotInlineResultPhotoArray ) Sort (less func (a , b InputBotInlineResultPhoto ) bool ) InputBotInlineResultPhotoArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultPhotoArray ) SortStable (less func (a , b InputBotInlineResultPhoto ) bool ) InputBotInlineResultPhotoArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultPhotoArray ) Retain (keep func (x InputBotInlineResultPhoto ) bool ) InputBotInlineResultPhotoArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineResultPhotoArray ) First () (v InputBotInlineResultPhoto , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineResultPhotoArray ) Last () (v InputBotInlineResultPhoto , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineResultPhotoArray ) PopFirst () (v InputBotInlineResultPhoto , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineResultPhoto
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineResultPhotoArray ) Pop () (v InputBotInlineResultPhoto , 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 InputBotInlineResultDocumentArray []InputBotInlineResultDocument
func (s InputBotInlineResultDocumentArray ) Sort (less func (a , b InputBotInlineResultDocument ) bool ) InputBotInlineResultDocumentArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultDocumentArray ) SortStable (less func (a , b InputBotInlineResultDocument ) bool ) InputBotInlineResultDocumentArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultDocumentArray ) Retain (keep func (x InputBotInlineResultDocument ) bool ) InputBotInlineResultDocumentArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineResultDocumentArray ) First () (v InputBotInlineResultDocument , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineResultDocumentArray ) Last () (v InputBotInlineResultDocument , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineResultDocumentArray ) PopFirst () (v InputBotInlineResultDocument , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineResultDocument
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineResultDocumentArray ) Pop () (v InputBotInlineResultDocument , 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 InputBotInlineResultGameArray []InputBotInlineResultGame
func (s InputBotInlineResultGameArray ) Sort (less func (a , b InputBotInlineResultGame ) bool ) InputBotInlineResultGameArray {
sort .Slice (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultGameArray ) SortStable (less func (a , b InputBotInlineResultGame ) bool ) InputBotInlineResultGameArray {
sort .SliceStable (s , func (i , j int ) bool {
return less (s [i ], s [j ])
})
return s
}
func (s InputBotInlineResultGameArray ) Retain (keep func (x InputBotInlineResultGame ) bool ) InputBotInlineResultGameArray {
n := 0
for _ , x := range s {
if keep (x ) {
s [n ] = x
n ++
}
}
s = s [:n ]
return s
}
func (s InputBotInlineResultGameArray ) First () (v InputBotInlineResultGame , ok bool ) {
if len (s ) < 1 {
return
}
return s [0 ], true
}
func (s InputBotInlineResultGameArray ) Last () (v InputBotInlineResultGame , ok bool ) {
if len (s ) < 1 {
return
}
return s [len (s )-1 ], true
}
func (s *InputBotInlineResultGameArray ) PopFirst () (v InputBotInlineResultGame , ok bool ) {
if s == nil || len (*s ) < 1 {
return
}
a := *s
v = a [0 ]
copy (a [0 :], a [1 :])
var zero InputBotInlineResultGame
a [len (a )-1 ] = zero
a = a [:len (a )-1 ]
*s = a
return v , true
}
func (s *InputBotInlineResultGameArray ) Pop () (v InputBotInlineResultGame , 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 .