Skip to content

Generated imports fail when we have an aliasΒ #90

@NoGambiNoBugs

Description

@NoGambiNoBugs

When we have some interface with methods that use parameters from another package that was imported with an alias... the result is not going well, just to explain:

This is working:

Code:

import ".../pkg/proto"

...

// MyInterface is a driven port.
//
//go:generate gowrap gen -g -i MyInterface -t ../templates/log.go.tmpl -o ./decorators/logs/url_shortener_gateway_with_logs.go
type MyInterface interface {
	MyMethod(ctx context.Context, body proto.Incomming) (proto.Outcomming, error)
}

This isn't working:

Code:

import alias ".../pkg/proto"

...

// MyInterface is a driven port.
//
//go:generate gowrap gen -g -i MyInterface -t ../templates/log.go.tmpl -o ./decorators/logs/url_shortener_gateway_with_logs.go
type MyInterface interface {
	MyMethod(ctx context.Context, body alias.Incomming) (alias.Outcomming, error)
}

I am using the latest version of package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions