pruepei / influx-proxy

Other
6 stars 4 forks source link

关于类型的使用 #8

Open Sn0rt opened 7 years ago

Sn0rt commented 7 years ago

在阅读cluster_test.go中,发现如下代码片段:

func CreateTestInfluxCluster() (ic *InfluxCluster, err error) {
    redisConfig := &RedisConfigSource{}
...
    cfg.WriteOnly = 1
...
    return
}

中的cfg.WriteOnly = 1 是不是bool类型更合理一些?

Sn0rt commented 7 years ago
func NewInfluxCluster(cfgsrc *RedisConfigSource, nodecfg *NodeConfig) (ic *InfluxCluster) {
    ic = &InfluxCluster{
....
        WriteTracing:   nodecfg.WriteTracing,
        QueryTracing:   nodecfg.QueryTracing,
    }
...
    return
}

WriteTracing是个开关吧? 建议类型bool