Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Why are methods in ProviderSet that provide interfaces defined in the dependence project being generated as ’invalid type’? #421

@NameOfGoy

Description

@NameOfGoy

Describe the bug

ProviderSet like :

import (
	"dependence-project/s3"
	"dependence-project/s3/minio"
	"github.com/google/wire"
)
var ProviderSet = wire.NewSet(NewS3)
func NewS3(dataConf *conf.Data) (s3.S3, error) {
	return minio.NewS3(dataConf.Minio.Endpoint, dataConf.Minio.AccessKeyId, dataConf.Minio.SecretAccessKey, false, "")
}

the s3 definition in the dependence project like this :
Image

wire.go:

func wireApp(*conf.Data) (*kratos.App, func(), error) {
	panic(wire.Build(s3.ProviderSet, newApp))
}

wire_gen.go:

invalid type, err := s3.NewS3(data)
if err != nil {
	return nil, nil, err
}

and the last generate err :
wire: 40:10: expected ';', found 'type' (and 1 more errors)

Expected behavior

I hope that it can be able to correctly generate the interface types defined in the dependency project

Version

0.6.0

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions