struct_tool

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetStringFromObj

func GetStringFromObj(obj interface{}) (keyString string)

GetStringFromObj obj为结构体实例 与test_tool中的GetSubTestName类似 返回值格式:keyName_keyValueString_keyName_keyValueString

func SetUpdateValue

func SetUpdateValue(originObjPtr, updateInfoObjPtr interface{}) (changed bool, originMap, changedMap map[string]interface{})

SetUpdateValue 将updateInfoObj这个结构体实例中的各项更新至originObj中各同名项中。 1. updateInfoObj 中的各项如果不是零值,且与originObj中的对应项值不同,才会更新至originObj 2. originObjPtr 是 originObj的指针;updateInfoObjPtr 是 updateInfoObj的指针 updateInfoObj中的各项如果不是zero value,则将originObj中同名的项的值更新 ! 注意:如果updateInfoObj中有些项刻意置为零值,在这里不会改变,需要额外单独赋值给originObj相应的项。例如,将state置为0,或将某字段置空“” changed: 表示原始值与info中有不同的值 originMap: 如果changed == true,orginMap中列出变动前的项和原始值 changedMap: 如果changed == true,changedMap中列出后的项和值

Types

This section is empty.

Jump to

Keyboard shortcuts

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