go 使用options扩展参数
摘要:
package main import ( "fmt" ) type Config struct { path string isUseFile bool } type ConfigOption func(config *Config) error func WithPath(path string 阅读全文
posted @ 2025-06-22 16:17 王景迁 阅读(7) 评论(0) 推荐(0)
posted @ 2025-06-22 16:17 王景迁 阅读(7) 评论(0) 推荐(0)
posted @ 2025-06-22 11:50 王景迁 阅读(15) 评论(0) 推荐(0)