json

package
v0.27.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumberFloat

func NumberFloat(i interface{}) float64

NumberFloat is a helper function to convert an expected float that is returned from a json Unmarshal as a Number, into an actual float64 without returning any errors. If there is an error, it just returns 0. Use this when you absolutely know you are expecting a float. Can convert strings too.

func NumberInt

func NumberInt(i interface{}) int

NumberInt is a helper function to convert an expected integer that is returned from a json Unmarshal as a Number, into an actual integer without returning any errors. If there is an error, it just returns 0. Use this when you absolutely know you are expecting an integer. Can convert strings too.

func NumberString

func NumberString(i interface{}) string

NumberString is a helper function to convert a value that might get cast as a Json Number into a string. If there is an error, it just returns 0. Use this when you absolutely know you are expecting a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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