Option to automatically add the keyed parameters of a struct
已完成
Hi all,
Let's say I got the following struct:
type Bh struct {
da string
sne string
}
When I want an instance of it, I can do both a := Bh{"x", "y"} but also b: = Bh{da:"x", sne:"y"}
The second option is better and a must in many cases (like with protobuf).
I tried to find a way to make Goland autocomplete Bh directly to Bh{da: sne:} in order for me to just fill in the details but with no avail (the closest I got is an auto complete feature for each parameter).
Is there a way to do that?
Thanks!
请先登录再写评论。
Hi,
For empty initializer you can invoke `Fill struct` action via Alt+Enter menu.
For filled initializer without structure keys, you can invoke `Add keys and delete zero values` via Alt+Enter menu.
Is that you're looking for?
Indeed it is! Thank you Alexander! :)