utils

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adr

func Adr[T interface{}](s T) *T

func DeserializeData

func DeserializeData[T interface{}](source any, target *T) T

func DumpObj2Local

func DumpObj2Local(obj interface{}, filepath string) error

func GetCodeLine

func GetCodeLine(skip int) string

调用 GetCodeLine 获取当前代码所在的行数

func GetRequest

func GetRequest(urlstr string, query ...QueryParam) (*http.Response, error)

func GreaterThan2interface

func GreaterThan2interface(a, b interface{}) (bool, error)

func LoadObj

func LoadObj(filepath string, obj interface{}) error

func Number2float64

func Number2float64(a interface{}) (float64, error)

func PostRequest

func PostRequest(urlstr string, body string) (*http.Response, error)

func PrintDataAsJson

func PrintDataAsJson(m interface{}) string

func SubInterface

func SubInterface(a, b interface{}) (interface{}, error)

func Typeof

func Typeof(v interface{}) string

func WrapError

func WrapError(err error) error

WrapError 包装错误信息,将发生错误的行数信息添加到错误信息中

Types

type QueryParam

type QueryParam struct {
	Name  string
	Value string
}

Jump to

Keyboard shortcuts

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