package configLoad import ( "log" "testing" ) func TestLoadConfig(t *testing.T) { path := "./config.yaml" configYaml := loadConfigFromYaml(path) kafkaAddr := configYaml.GetStringSlice("kafka.brokers") redisAddr := configYaml.GetStringSlice("redis.address") log.Printf("Kafka brokers is %v", kafkaAddr) log.Printf("Redis address is %v", redisAddr) } func Test_LoadConfig(t *testing.T) { configYaml := LoadConfig() redisAdd := configYaml.GetString("redis.address") alarmTopic := configYaml.GetString("kafka.topics.alarm") kafkaBrokers := configYaml.GetStringSlice("kafka.brokers") log.Printf("Kafka brokers is %v", redisAdd) log.Printf("Kafka topics alarm is %v", alarmTopic) log.Printf("Redis address is %v", kafkaBrokers) }