Comments (4)
I like the latter but not the former. I don't like the idea of implying that IDE breakage is OK, even if you as the developer really really want to do it.
from wire.
I agree with @cflewis. Avoiding an API which requires panic
is consistent with what I understand idiomatic Go to be.
from wire.
Throwing another hat into the ring, could the API be flipped? So, instead of returning the type you provide, the type is the receiver?
func (*app) injectorTemplate() {
wire.Use(...)
}
from wire.
@tbpg Wouldn't work because an injector can return errors and cleanup functions, not just one type. It's a nice idea, though. I played around with a couple variants and couldn't find a way to get the idea to work for all the current cases.
from wire.
Related Issues (20)
- Missing `go run` or `go build` example of generated code HOT 4
- Is wire still maintained ? HOT 4
- How to work with un-exported interfaces HOT 1
- [Question] Is there a guice for build a singleton object?
- Missed receiver in generated inject method
- Support for concurrent initialization
- function generated by Wire_gen.go "Cannot find declaration to go to" by Golang JetBrains but still run success HOT 5
- Calling wire.Build with a provider set from a structure variable (For modular buildings)
- wire `sync.Map` throw error HOT 2
- I has bean tried for two days, but failed. I define four struct and it's constructor, I define a init function in wire.go, but I can
- I can't use the init function which from my wire.go in my main.go HOT 3
- wire.NewSet support generics HOT 1
- internal/wire: update the path of wire which go generate run wire cmd
- Wire: not enough arguments in call to xxx
- is wire.FieldsOf support any field ? HOT 1
- Support for request scoped DI code generation HOT 2
- Injecting the subpackage into the parent package results in the error "no provider found for invalid type". HOT 2
- How to use wire.Bind() if concrete implementation is resolved at runtime? HOT 2
- please create new tag for 0675cdc
- Crashing with Go 1.22 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wire.