Ai
1 Star 0 Fork 0

宁成增/base-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
options.go 464 Bytes
一键复制 编辑 原始数据 按行查看 历史
宁成增 提交于 2021-01-11 20:33 +08:00 . init
package flag
import (
"context"
"gitee.com/psdnfu/base-core/config/source"
)
type includeUnsetKey struct{}
// IncludeUnset toggles the loading of unset flags and their respective default values.
// Default behavior is to ignore any unset flags.
func IncludeUnset(b bool) source.Option {
return func(o *source.Options) {
if o.Context == nil {
o.Context = context.Background()
}
o.Context = context.WithValue(o.Context, includeUnsetKey{}, true)
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/psdnfu/base-core.git
git@gitee.com:psdnfu/base-core.git
psdnfu
base-core
base-core
v0.0.1

搜索帮助