golang整洁之道(一)
设计工整的go项目配置文件 问题背景 项目经常会涉及到配置文件,而配置文件往往包含多方的配置信息,可能同时涉及到MySQL,kafka,hive,hdfs等等。 不加思索的yaml配置文件 最快,最直接的方案自然是如下示例,直接写 yaml部分 hdfs_path: "/user/hive/warehouse/dm_user.db/user_vod_time/create_time=" hdfs_host: "hdfsNode9" hdfs_port: "8020" eth_host: "http://127.0.0.1" eth_port: "8545" coin_password: "password" golang部分 package config type config struct...阅读全文