Source File
tl_true_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.package tgimport ()// No-op definition for keeping imports.var (_ = bin.Buffer{}_ = context.Background()_ = fmt.Stringer(nil)_ = strings.Builder{}_ = errors.Is_ = multierr.AppendInto_ = sort.Ints_ = tdp.Format_ = tgerr.Error{}_ = tdjson.Encoder{})// True represents TL type `true#3fedd339`.// See predefined identifiers¹.//// Links:// 1. https://core.telegram.org/mtproto/TL-formal#predefined-identifiers//// See https://core.telegram.org/constructor/true for reference.type True struct {}// TrueTypeID is TL type id of True.const TrueTypeID = 0x3fedd339// Ensuring interfaces in compile-time for True.var (_ bin.Encoder = &True{}_ bin.Decoder = &True{}_ bin.BareEncoder = &True{}_ bin.BareDecoder = &True{})func ( *True) () bool {if == nil {return true}return true}// String implements fmt.Stringer.func ( *True) () string {if == nil {return "True(nil)"}type Truereturn fmt.Sprintf("True%+v", (*))}// TypeID returns type id in TL schema.//// See https://core.telegram.org/mtproto/TL-tl#remarks.func (*True) () uint32 {return TrueTypeID}// TypeName returns name of type in TL schema.func (*True) () string {return "true"}// TypeInfo returns info about TL type.func ( *True) () tdp.Type {:= tdp.Type{Name: "true",ID: TrueTypeID,}if == nil {.Null = truereturn}.Fields = []tdp.Field{}return}// Encode implements bin.Encoder.func ( *True) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode true#3fedd339 as nil")}.PutID(TrueTypeID)return .EncodeBare()}// EncodeBare implements bin.BareEncoder.func ( *True) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't encode true#3fedd339 as nil")}return nil}// Decode implements bin.Decoder.func ( *True) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode true#3fedd339 to nil")}if := .ConsumeID(TrueTypeID); != nil {return fmt.Errorf("unable to decode true#3fedd339: %w", )}return .DecodeBare()}// DecodeBare implements bin.BareDecoder.func ( *True) ( *bin.Buffer) error {if == nil {return fmt.Errorf("can't decode true#3fedd339 to nil")}return nil}
![]() |
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. |