utilities

package
v0.0.0-...-26b15f6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetURLSuffix

func GetURLSuffix(r *http.Request) string

GetURLSuffix returns last part of the url url: poll/10/edit => returned: edit

func Round

func Round(val float64) int

Round is utility function for rounding floats to nearest integer

func StringInSlice

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

StringInSlice returns true if string exists in array and false if it does not

func TimeDiff

func TimeDiff(t time.Time) string

TimeDiff returns time difference between inserted time and time now in suitable format according to number of: seconds if time < 1min minutes if time < 1hour hours if time < 1 day days if time < 1 month months if time < 1 year years if time > 1 year

Types

This section is empty.

Jump to

Keyboard shortcuts

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