convert

package
v2.0.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package convert common data converter, base "reflect".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSlice

func IsSlice(s string) bool

IsSlice determine whether the string conforms to the slice

func SetByStr

func SetByStr(value reflect.Value, s string) bool

SetByStr set the literal string to any specified type

The types are as follows:

1. string, convert the original input string.

2. bool, parse string true, True, false, False etc.

3. int64, parse a numeric string to int64.

4. float, parse numeric strings into floats.

5. uint64, parse a numeric string to uint64.

func SetByStrSlice

func SetByStrSlice(value reflect.Value, vSlice []string) bool

SetByStrSlice Assigns a string array to another type of slice

func ToSlice

func ToSlice(s string) (vSlice []string, isMatch bool)

ToSlice convert string to slice, format `[e0, e1, ..., en]`

Types

This section is empty.

Jump to

Keyboard shortcuts

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