Skip to content

Tags: josharian/impl

Tags

v1.4.0

Fix generation failure when multiple type parameters are in the receiver

Also fixes duplicate method generation for already implemented methods
of structs with type parameters.

v1.3.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
support generics

Add support for generic interfaces, i.e. interfaces that accept a type parameter.

For example, you can now have this kind of interface:

```go
type Interface[Kind any] interface {
	DoTheThing() Kind
}
```

and if you run `impl 's StringImpl' 'Interface[string]` it will generate
the following code:

```go
func (s StringImpl) DoTheThing() string {
	// normal impl stub here
}
```

Add a Type abstraction, make type parsing more robust.

Instead of parsing generic types using string manipulation, parse them using the go/parse package to get the AST.

Rather than passing around a type ID and its params everywhere, create a Type struct that contains both.

Fixes #44.

Co-authored-by: Josh Bleecher Snyder <josharian@gmail.com>

v1.2.0

avoid name collisions between receiver and params/results

Fixes #46

v1.1.0

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
mention vim-go supporting this command (#39)

vim-go has useful "GoImpl" command.

v1.0.0

add github action

just run the tests