Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有计划生成struct的时候顺便把 字段字符串也生成出来吗 #94

Closed
april68666 opened this issue Dec 7, 2020 · 4 comments
Labels
good first issue Good for newcomers Repaired Repaired(已修复)

Comments

@april68666
Copy link

type User struct{
  ID int
 Name string
}

Columns = struct {
	ID              string
        Name         string       
	}{
	ID:  "id",                  
        Name: "name",           
	}

类似这样的,然后使用gorm 的 Select(Columns.Name) ,就可以了不用写死硬编码字符串容易出错

@xxjwxc
Copy link
Owner

xxjwxc commented Dec 7, 2020

好建议,请留意更新

@xxjwxc xxjwxc added the good first issue Good for newcomers label Dec 8, 2020
@xxjwxc xxjwxc pinned this issue Dec 8, 2020
@xxjwxc
Copy link
Owner

xxjwxc commented Dec 9, 2020

已经添加:
bceb63b
请配置config.yml
is_table_name : true

@xxjwxc xxjwxc added the Repaired Repaired(已修复) label Dec 9, 2020
@april68666
Copy link
Author

已经添加:
bceb63b
请配置config.yml
is_table_name : true

神速啊感谢哈哈

@xxjwxc xxjwxc closed this as completed Dec 22, 2020
@xxjwxc xxjwxc unpinned this issue Dec 23, 2020
@lifegit
Copy link

lifegit commented Aug 6, 2021

这种方式会存在安全隐患呀! #159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Repaired Repaired(已修复)
Projects
None yet
Development

No branches or pull requests

3 participants