utils

package
v0.0.0-...-3a80bc8 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a1, a2 int) int

Add

func AvoidXSS

func AvoidXSS(theHTML string) string

AvoidXSS 避免XSS

func DateFormat

func DateFormat(date time.Time, layout string) string

格式化时间

func IsEven

func IsEven(number int) bool

判断数字是否是偶数

func IsOdd

func IsOdd(number int) bool

判断数字是否是奇数

func MarkdownToHTML

func MarkdownToHTML(md string) string

MarkdownToHTML 将markdown 转换为 html

func SetStructByJSON

func SetStructByJSON(obj interface{}, mapData map[string]interface{}) error

SetStructByJSON 由json对象生成 struct

func Substring

func Substring(source string, start, end int) string

截取字符串

func Truncate

func Truncate(s string, n int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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