dssj88098 2019-08-09 10:41
浏览 303
已采纳

为什么“ go vet”仅在某些版本的Go中抱怨? [关闭]

Today I included 'go vet' in one of my pipelines that builds a go service. I wonder why go vet's output on my local machine is different from the one that runs on the CI server.

I figured out that the go version differs - at least a bit. My local Go version is 1.12.4 and the CIs is version 1.12.7. This fact would explain the different behaviour, but I don't get why this happens!

There is the smell:

type Something struct {
    ...
    BatteryNumber string    `json:"number"`
    ...
}

type SomethingWithBattery struct {
    Something
    Number            string   `json:"number"`
    ...
}

So, two times 'number' in the struct tags, because Something-struct is nested SomethingWithBattery - 1.12.4 complains, 1.12.7 does not. Why?

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥20 b站私信完整导出的方法
      • ¥15 边界图中的x、y轴解释
      • ¥30 如何用matlab求解复杂方程
      • ¥15 VUE TS中怎么调用第三方js
      • ¥15 Activiti如何将值传入textValue
      • ¥20 在linux里安装lummps时 在make mpi里找不到rpc
      • ¥25 python先到先得调度和轮询调度
      • ¥15 SDK Manager闪退
      • ¥15 intel i219v mac地址修改问题
      • ¥15 leetcode上面的题,求解