LocationForPC sets the constructor pointer to a specified location. Use this Options to reduce vague debug message when constructor are made by reflect.makeFunc. For example: LocationForPC(reflect.makeFunc(...), reflect.ValueOf(realConstructor).Pointer())
(constructor interface{}, pc uintptr)
| 19 | // reflect.makeFunc. For example: |
| 20 | // LocationForPC(reflect.makeFunc(...), reflect.ValueOf(realConstructor).Pointer()) |
| 21 | func LocationForPC(constructor interface{}, pc uintptr) interface{} { |
| 22 | if op, ok := constructor.(OptionalProvider); ok { |
| 23 | op.Options = append(op.Options, dig.LocationForPC(pc)) |
| 24 | return op |
| 25 | } |
| 26 | return OptionalProvider{ |
| 27 | Constructor: constructor, |
| 28 | Options: []dig.ProvideOption{dig.LocationForPC(pc)}, |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | // As constructs the instance and bind it to another interface. As means to be used as an argument to graph.Provide. |
| 33 | // For example: |
no outgoing calls