conv

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Helper functions for handling conversions between types.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrettyByte added in v0.24.1

func PrettyByte(bytes []byte) string

PrettyByte bytes to string

func StringToFloat64

func StringToFloat64(s string) float64

Convert string to Float64. Any character is treated as decimal separator.

func StringToInt

func StringToInt(s string) int

Convert string to Int. If decimal number is given, will round the result down.

func StringToInt64 added in v0.26.5

func StringToInt64(s string) int64

Convert string to Int64. If decimal number is given, will round the result down.

func StringToTime

func StringToTime(t string) time.Time

Converts string to time.Time object. Time format:

"2006-01-02T15:04:05.000000Z07"

func TimeToString

func TimeToString(t time.Time) string

Converts time.Time object to string. Time format:

"2006-01-02T15:04:05.000000Z07"

func Use

func Use(v interface{}) string

Converts any input type to string representation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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