Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wire: unused provider error when only pointer to struct is used #29

Closed
zombiezen opened this issue Aug 14, 2018 · 0 comments
Closed

wire: unused provider error when only pointer to struct is used #29

zombiezen opened this issue Aug 14, 2018 · 0 comments
Assignees

Comments

@zombiezen
Copy link
Collaborator

Repro case:

package main

import "github.com/google/go-cloud/wire"

type Foo struct{}

func inject() *Foo {
  wire.Build(Foo{})
  return nil
}

This produces the error:

foo.go:7:1: inject inject: unused provider "Foo"
wire: generate failed

I expect this to succeed.

vangent referenced this issue in vangent/go-cloud Aug 15, 2018
vangent referenced this issue in vangent/go-cloud Aug 15, 2018
vangent referenced this issue in vangent/go-cloud Aug 15, 2018
of the provided concrete type in ProviderSet.providerMap, to more
clearly model named struct providers (which provide both the struct
type and a pointer to the struct type).

Fixes #325.
vangent referenced this issue in vangent/go-cloud Aug 16, 2018
of the provided concrete type in ProviderSet.providerMap, to more
clearly model named struct providers (which provide both the struct
type and a pointer to the struct type).

Fixes #325.
vangent referenced this issue in vangent/go-cloud Aug 16, 2018
of the provided concrete type in ProviderSet.providerMap, to more
clearly model named struct providers (which provide both the struct
type and a pointer to the struct type).

Fixes #325.
vangent referenced this issue in vangent/go-cloud Aug 16, 2018
of the provided concrete type in ProviderSet.providerMap, to more
clearly model named struct providers (which provide both the struct
type and a pointer to the struct type).

Fixes #325.
zombiezen referenced this issue in google/go-cloud Aug 16, 2018
…rack of the provided concrete type in ProviderSet.providerMap (#332)

Update Provider.Out to be a slice of provided types, and keep track
of the provided concrete type in ProviderSet.providerMap, to more
clearly model-named struct providers (which provide both the struct
type and a pointer to the struct type).

Fixes #325.
zombiezen referenced this issue Nov 28, 2018
…rack of the provided concrete type in ProviderSet.providerMap (google/go-cloud#332)

Update Provider.Out to be a slice of provided types, and keep track
of the provided concrete type in ProviderSet.providerMap, to more
clearly model-named struct providers (which provide both the struct
type and a pointer to the struct type).

Fixes google/go-cloud#325.
@zombiezen zombiezen transferred this issue from google/go-cloud Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants