mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 11:29:48 +08:00
26f06dd732
Signed-off-by: SimFG <bang.fu@zilliz.com>
28 lines
481 B
Go
28 lines
481 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"sort"
|
|
|
|
"github.com/spf13/viper"
|
|
"go.uber.org/zap"
|
|
|
|
"github.com/milvus-io/milvus/pkg/log"
|
|
)
|
|
|
|
func ShowYaml(filepath string) {
|
|
reader := viper.New()
|
|
reader.SetConfigFile(filepath)
|
|
if err := reader.ReadInConfig(); err != nil {
|
|
log.Warn("read config failed", zap.Error(err))
|
|
os.Exit(-3)
|
|
}
|
|
keys := reader.AllKeys()
|
|
sort.Strings(keys)
|
|
for _, key := range keys {
|
|
v := reader.GetString(key)
|
|
fmt.Fprintln(os.Stdout, key, "=", v)
|
|
}
|
|
}
|