encoding

package module
v0.0.0-...-15635d3 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 1 Imported by: 0

README

encoding

Extensions to the Go standard library's encoding set.

encoding/maps

An encoding package that facilitates marshaling and unmarshaling structs to and from map[string]interface{} containers.

Documentation

Overview

Package encoding is an extension to the Go Standard Library's encoding (https://godoc.org/encoding) package. It defines interfaces and helper functions shared by other packages (specifically the sub-packages of this library).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil

func IsNil(v interface{}) bool

IsNil returns true if the given value `v` is equivalent to nil, either because it is an `IsNiler` and `v.IsNil()` returns `true`, or it is a channel, function variable, interface, map, pointer, or slice whose value is the associated `nil`.

func IsValueNil

func IsValueNil(v reflect.Value) bool

IsValueNil returns true if the given reflect.Value `v` is equivalent to nil, either because it is an `IsNiler` and `v.IsNil()` returns `true`, or it is a channel, function variable, interface, map, pointer, or slice whose value is the associated `nil`.

func IsValueZero

func IsValueZero(v reflect.Value) bool

func IsZero

func IsZero(v interface{}) bool

IsZero returns true if the given value `v` is that type's zero value, either because it is an `IsZeroer` and `v.IsZero()` returns `true`, or if it is equal to that type's default zero value.

Types

type IsNiler

type IsNiler interface {
	IsNil() bool
}

IsNiler is an interface implemented by an object with a nil value that may differ from Go's default nil value. This is used in encoding/map with the "omitnil" struct tag to give fields a chance to specify when they should be omitted due to containing a nil value.

type IsZeroer

type IsZeroer interface {
	IsZero() bool
}

IsZeroer is an interface implemented by an object with a zero value that may differ from Go's default zero value. This is used in encoding/map with the "omitzero" struct tag to give fields a chance to specify when they should be omitted due to containing a zero value.

Directories

Path Synopsis
Package maps provides helper functions and struct tags that facilitate the conversion of structs to `map[string]interface{}`s, and vice-versa.
Package maps provides helper functions and struct tags that facilitate the conversion of structs to `map[string]interface{}`s, and vice-versa.
Package types defines a number of helper types that bridge the packages database/sql, encoding, encoding/json, and encoding/maps.
Package types defines a number of helper types that bridge the packages database/sql, encoding, encoding/json, and encoding/maps.
null
Package null defines a number of nullable types that bridge the packages database/sql, encoding, encoding/json, and encoding/maps.
Package null defines a number of nullable types that bridge the packages database/sql, encoding, encoding/json, and encoding/maps.

Jump to

Keyboard shortcuts

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