1 Star 0 Fork 0

Erdian718/cli

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
context.go 464 Bytes
一键复制 编辑 原始数据 按行查看 历史
Erdian718 提交于 2025-10-14 14:40 +08:00 . Add resolve methods for Context
package cli
import (
"context"
"reflect"
"gitee.com/erdian718/ioc"
)
// Context represents the action context.
type Context struct {
context.Context
scope *ioc.Scope
}
// Resolve resolves the dependencies.
func (ctx *Context) Resolve(values ...any) error {
return ctx.scope.Resolve(values...)
}
// ResolveType resolves the dependencies by type.
func (ctx *Context) ResolveType(t reflect.Type) (reflect.Value, error) {
return ctx.scope.ResolveType(t)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/erdian718/cli.git
git@gitee.com:erdian718/cli.git
erdian718
cli
cli
v0.9.2

搜索帮助