codeGenerator

package
v0.0.0-...-afccd23 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenStructAssignCode

func GenStructAssignCode(src, dest interface{}, srcTag, destTag string) string

GenStructAssignCode 根据结构体字段生成从 src 到 dest 的赋值代码。 src 和 dest 参数必须是结构体类型,并且该函数将通过字段名进行匹配。 srcTag 和 destTag 参数可以用来指定生成代码中使用的变量名。 如果 srcTag 或 destTag 是空字符串,将分别使用默认变量名 "src" 或 "dest"。 函数返回包含生成的赋值代码的字符串。 如果 src 或 dest 任一不是结构体类型,函数将返回错误信息。

Types

This section is empty.

Jump to

Keyboard shortcuts

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