官方文档:
https://micro.mu/docs/go-config.html
https://github.com/micro/go-micro/tree/master/config/source/cli
cliConfig := cli.StringFlag{
Name: "f",
Value: "./cfg/cfg.json",
Usage: "pls use config file",
}
需注册到micro服务中
service := micro.NewService(
micro.Flags(cliConfig),
)

原文:https://www.cnblogs.com/LC161616/p/12104497.html