convert

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 3 Imported by: 12

Documentation

Overview

Package convert some parameter conversion utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fnv32

func Fnv32(str string) uint32

Fnv32 Fnv-hash algorithm FNV can quickly hash large amounts of data while maintaining a low collision rate. Its high dispersion makes it suitable for hashing very similar strings.

func StrSlice2Map

func StrSlice2Map(list []string) map[string]struct{}

StrSlice2Map converts a string slice into a map. Note: it will filter out empty strings.

func ToIntSlice

func ToIntSlice(list []string) ([]int, error)

ToIntSlice converts to a list of integers.

func ToJSONStr

func ToJSONStr(o interface{}) string

ToJSONStr converts to JSON string for logging purposes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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