nulls

package
v0.0.0-...-1a66df0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseEncoding

func BaseEncoding() error

BaseEncoding shows encoding and decoding with normal types

func NullEncoding

func NullEncoding() error

NullEncoding shows an alternative method for dealing with nil/omitted values

func PointerEncoding

func PointerEncoding() error

PointerEncoding shows methods for dealing with nil/omitted values

Types

type Example

type Example struct {
	Age  int    `json:"age,omitempty"`
	Name string `json:"name"`
}

Example is a basic struct with age and name fields

type ExampleNullInt

type ExampleNullInt struct {
	Age  *nullInt64 `json:"age,omitempty"`
	Name string     `json:"name"`
}

ExampleNullInt is the same, but uses a sql.NullInt64

type ExamplePointer

type ExamplePointer struct {
	Age  *int   `json:"age,omitempty"`
	Name string `json:"name"`
}

ExamplePointer is the same, but uses a *Int

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL