比如,写个字段
// Name 名称。
Name string `json:"name"`
期望是,写了“Name string”,自动补上 “名称。”之外的部分。
1
wuzhewuyou 167 天前 via Android
写到吐,吐着吐着也就习惯了
|
![]() |
2
idblife 167 天前
github copilot ?
|
![]() |
3
jenlors 167 天前
Goland
|
![]() |
4
FrankFang128 167 天前
copilot
|
![]() |
5
wencan OP |
7
vvhhaaattt 167 天前 via Android
https://app.quicktype.io/ 用 json 转 go struct 也是一个方法。
|
8
ssjmhyvi 167 天前
|
9
securityCoding 167 天前 via Android
换 goland 或者 copilot
|
![]() |
10
bandian 167 天前 via iPhone
试试 maxnatchanon.go-struct-tag-autogen ,目前正在用,需要稍微配置一下,效果还可以
|
![]() |
11
bandian 167 天前 via iPhone
可以实现输入 Name string `j 补全后面的部分
|
![]() |
12
LukeEuler 167 天前
官方 golang 插件: https://marketplace.visualstudio.com/items?itemName=golang.Go
命令:Go: Add Tags To Struct Fields 至于注释,我就不知道了 |
13
Slurp 166 天前 via iPad
这种应该可以 snippet… IDEA 上类似的有 live template 。不过说到底是 Go 编译时特性不足,隔壁 Rust 只用在 struct 头上写一次就行…
|
14
zzhzero 166 天前
我以为这种 goland 的基础功能 vscode 早就有插件实现了
|
15
yaott2020 128 天前 via Android
说实话,不喜欢用 vscode 写 go 就是自动不全太烂了
|
16
yaott2020 128 天前 via Android
不如用 goland
|