Hi, I use go.nvim for my daily golang stuff for personal projects. I love this project.
Is there any plans to add command for generating constructor (NewXxx) from struct?
go.nvim already has GoFillStruct, GoImpl, GoAddTag — so GoCtor (GoConstructor/Goctor/GoConstr...) feels like it shuold be there too, no?
Basically what I mean:
Cursor on struct:
type User struct {
name string
age int
email string
}
:GoCtor would generate smth like:
func NewUser(name string, age int, email string) *User {
return &User{
name: name,
age: age,
email: email,
}
}
How it could work maybe:
- Parse struct fields via treesitter (same way
GoAddTag does it)
Hi, I use go.nvim for my daily golang stuff for personal projects. I love this project.
Is there any plans to add command for generating constructor (
NewXxx) from struct?go.nvim already has
GoFillStruct,GoImpl,GoAddTag— soGoCtor(GoConstructor/Goctor/GoConstr...) feels like it shuold be there too, no?Basically what I mean:
Cursor on struct:
:GoCtorwould generate smth like:How it could work maybe:
GoAddTagdoes it)