misc

package
v0.0.0-...-e933087 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package misc defines miscellaneous useful functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Atoi

func Atoi(candidate string) int

Atoi returns casted int

func IsSuccessHTTPRequest

func IsSuccessHTTPRequest(t *testing.T, actual *http.Response, err error) bool

IsSuccessHTTPRequest checks whether the HTTP request was success.

func NVL

func NVL(str string, def string) string

NVL is null value logic

func ParseBool

func ParseBool(candidate string) bool

ParseBool returns casted bool

func ParseCsvLine

func ParseCsvLine(data string) []string

ParseCsvLine returns comma splitted strings

func ParseDuration

func ParseDuration(candidate string) time.Duration

ParseDuration returns casted time.Duration

func ParseHTTPResponse

func ParseHTTPResponse(res *http.Response) (string, int)

ParseHTTPResponse parses a HTTP response to string.

func ParseUint16

func ParseUint16(candidate string) uint16

ParseUint16 returns casted uint16

func ReadFromFile

func ReadFromFile(path string, data interface{}) error

ReadFromFile reads data from a file

func SaveAsFile

func SaveAsFile(path string, data interface{}) error

SaveAsFile saves data as a file

func ShellExec

func ShellExec(command []string) (result string, err error)

ShellExec executes the commands

func StringToTime

func StringToTime(t string) time.Time

StringToTime changes string to time.Time

func TimeToJST

func TimeToJST(t time.Time) time.Time

TimeToJST changes time.Time to Tokyo time zone

func TimeToString

func TimeToString(t time.Time) string

TimeToString changes time.Time to string

func ZeroOrNil

func ZeroOrNil(obj interface{}) bool

ZeroOrNil checks if the argument is zero or null

Types

This section is empty.

Jump to

Keyboard shortcuts

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