Source File
tl_null_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
)
// 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{}
)
// Null represents TL type `null#56730bcc`.
// Corresponds to an arbitrary empty object.
//
// See https://core.telegram.org/constructor/null for reference.
type Null struct {
}
// NullTypeID is TL type id of Null.
const NullTypeID = 0x56730bcc
// Ensuring interfaces in compile-time for Null.
var (
_ bin.Encoder = &Null{}
_ bin.Decoder = &Null{}
_ bin.BareEncoder = &Null{}
_ bin.BareDecoder = &Null{}
)
func ( *Null) () bool {
if == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func ( *Null) () string {
if == nil {
return "Null(nil)"
}
type Null
return fmt.Sprintf("Null%+v", (*))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Null) () uint32 {
return NullTypeID
}
// TypeName returns name of type in TL schema.
func (*Null) () string {
return "null"
}
// TypeInfo returns info about TL type.
func ( *Null) () tdp.Type {
:= tdp.Type{
Name: "null",
ID: NullTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{}
return
}
// Encode implements bin.Encoder.
func ( *Null) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode null#56730bcc as nil")
}
.PutID(NullTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *Null) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode null#56730bcc as nil")
}
return nil
}
// Decode implements bin.Decoder.
func ( *Null) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode null#56730bcc to nil")
}
if := .ConsumeID(NullTypeID); != nil {
return fmt.Errorf("unable to decode null#56730bcc: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *Null) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode null#56730bcc 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. |