util

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2017 License: BSD-3-Clause Imports: 4 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cast

func Cast(num float64) int

Cast rounds num to integer.

func Contains

func Contains(slice []int32, item int32) bool

Contains reports whether an item is within the slice.

func FillStruct added in v0.2.0

func FillStruct(m map[string]interface{}, s interface{}) error

FillStruct converts map to struct.

func Hash

func Hash(s string) uint32

Hash generates hash number of a string.

func Round

func Round(num float64, precision int) float64

Round implements the round function.

func StringInSlice added in v0.3.0

func StringInSlice(str string, list []string) bool

StringInSlice checks if item is in slice/array.

func Sum

func Sum(nums []float64) float64

Sum sums all numbers in nums.

Types

This section is empty.

Jump to

Keyboard shortcuts

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