golang sqlx查询时, struct字段冲突

type TA struct {

  Id int64 `db:"id"`

}

type TB struct {

  Id int64 `db:"id"`

}

type TC struct {

  TA

  TB

}

如上的sql和结构体, 当查询sql,用TC结构体封装时, 有两个id字段,  那么数据库中id的值是在TB的id中

如果TC的结构体是

type TC struct {

  TB

  TA

}

这样, 那么id的值就是在TA中

原文地址:https://www.cnblogs.com/-xuzhankun/p/10861133.html