package file import ( "context" "IotAdmin/core/config/source" ) type filePathKey struct{} // WithPath 设置文件路径 func WithPath(p string) source.Option { return func(o *source.Options) { if o.Context == nil { o.Context = context.Background() } o.Context = context.WithValue(o.Context, filePathKey{}, p) } }