utils

package
v0.0.0-...-f37401a Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2018 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndWith

func EndWith(str string, substr string) bool

EndWith 是否以某个字符串结尾

func MapEncode

func MapEncode(in map[string]interface{}) string

MapEncode ...

func Period2Suffix

func Period2Suffix(period string, special1h bool) string

Period2Suffix *m => *min, *h => *hour, *w => *week, *d => *day, special60 如果为true 则 1h => 60min

func SliceEncode

func SliceEncode(s []SortPair) string

SliceEncode ...

func Strftime

func Strftime(t interface{}) string

Strftime 格式化成时间格式

func Ternary

func Ternary(exp bool, a interface{}, b interface{}) interface{}

Ternary 三目运算符

func ToFloat

func ToFloat(i interface{}) float64

ToFloat ...

func ToString

func ToString(i interface{}) string

ToString ...

Types

type SortPair

type SortPair struct {
	Key   string
	Value interface{}
}

SortPair ...

func SortMap

func SortMap(from map[string]interface{}) []SortPair

SortMap ...

Jump to

Keyboard shortcuts

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