rjeczalik / interfaces

Code generation tools for Go.
MIT License
420 stars 31 forks source link

Invalid code generated for a method returning map #18

Closed kyoh86 closed 4 years ago

kyoh86 commented 4 years ago

interfacer generates invalid response.


$ cat bar.go
package foo

import (
        "net/url"
)

type Bar struct {
}

func (b *Bar) Map() map[string]url.URL {
        return nil
}
$ interfacer -as foo.Foo -for ..Bar
// Created by interfacer; DO NOT EDIT

package foo

import (
        "net/url"
)

// Foo is an interface generated for "..Bar".
type Foo interface {
        Map() map[string]net/url.URL  // This's invalid response
}```
kyoh86 commented 4 years ago

Sorry, It's fixed already.

$ go get -u github.com/rjeczalik/interfaces/cmd/interfacer