Home
Sign Up
Sign In
The Go Programming Language
›
http://golang.org/
›
Go Playground
Go Projects
›
Revel Web Framework
Advertisement
V2EX
›
Go 编程语言
struct tag 变得太长了,很容易出错
noobsheldon
·
Oct 2, 2019
via Android · 4017 views
This topic created in 2605 days ago, the information mentioned may be changed or developed.
有一个结构体,使用 orm,json, validate 等各种 tag 过后,struct tag 就变得特别长。好像没有一种单独编写 tag 的方式…
tag
struct
JSON
orm
2 replies
•
2019-10-04 12:51:23 +08:00
freestyle
Oct 2, 2019 via iPhone
1
golangd 有 structtag 语法错误的 warning 提示. 跑 golint 也会提示.
reus
Oct 4, 2019
2
用多行字符串
foo int `
json:"foo"
db:"foo"
...
`
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Privacy
·
Solana
·
940 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 24ms ·
UTC 21:05
·
PVG 05:05
·
LAX 13:05
·
JFK 16:05
♥ Do have faith in what you're doing.
❯