Skip to content

Add quick fix to create method on structure #1943

@dlsniper

Description

@dlsniper

In the following case

package main

type demo struct{}

func (a *demo) Hello() {
    a.World()
}

func (a demo) Aloha() {
    a.NewWorld()
}

func main() {
}

It would be nice if the plugin could give me the option to create a method on *demo called World.
Return types and arguments would also be good if they could be detected but this can be ignored for now if the cursor would be placed in the arguments section.
The receiver should be also the same type and name as the method this is being called from, so for example we can generate:

func (a *demo) World()
// AND
func (a demo) NewWorld()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions