nulls

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 3 Imported by: 4

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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