util

package module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

README

go-util

golang utility library

Documentation

Index

Constants

View Source
const TimeLayout = "2006-1-2"

Variables

This section is empty.

Functions

func ExecShell

func ExecShell(s string) (string, error)

func FilePathExists

func FilePathExists(filename string) (bool, string)

判断资源包是否存在

func FirstDateOfNextWeek

func FirstDateOfNextWeek() (weekMonday string)

func FirstDateOfNextWeekByDate

func FirstDateOfNextWeekByDate(dateStr string) (weekMonday string)

func FirstDateOfWeek

func FirstDateOfWeek() (weekMonday string)

var cdate = "2020-2-4" fmt.Println("first date custom date:", FirstDateOfWeekByDate(cdate)) fmt.Println("first date next week by custom date:", FirstDateOfNextWeekByDate(cdate))

func FirstDateOfWeekByDate

func FirstDateOfWeekByDate(dateStr string) (weekMonday string)

func FixUrlHost added in v0.1.4

func FixUrlHost(host string) string

func FixUrlPath added in v0.1.4

func FixUrlPath(path string) string

func GetFirstDateOfWeek

func GetFirstDateOfWeek(customDate bool, dateStr string) (weekMonday time.Time)

* 获取本周周一的日期

func JsonFromFile added in v0.1.3

func JsonFromFile(fileFullName string, v interface{}) error

func Md5 added in v0.1.3

func Md5(source string) string

func Sha1 added in v0.1.3

func Sha1(source string) string

func WriteToFile

func WriteToFile(fullname string, content string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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