The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
noobsheldon

struct tag 变得太长了,很容易出错

  •  
  •   noobsheldon · Oct 2, 2019 via Android · 3937 views
    This topic created in 2500 days ago, the information mentioned may be changed or developed.

    有一个结构体,使用 orm,json, validate 等各种 tag 过后,struct tag 就变得特别长。好像没有一种单独编写 tag 的方式…

    2 replies    2019-10-04 12:51:23 +08:00
    freestyle
        1
    freestyle  
       Oct 2, 2019 via iPhone
    golangd 有 structtag 语法错误的 warning 提示. 跑 golint 也会提示.
    reus
        2
    reus  
       Oct 4, 2019
    用多行字符串
    foo int `
    json:"foo"
    db:"foo"
    ...
    `
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2692 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 12:30 · PVG 20:30 · LAX 05:30 · JFK 08:30
    ♥ Do have faith in what you're doing.