Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve this section ? #16

Open
patrickalin opened this issue Jun 22, 2017 · 1 comment
Open

Improve this section ? #16

patrickalin opened this issue Jun 22, 2017 · 1 comment
Assignees

Comments

@patrickalin
Copy link
Owner

Is it possible to improve the presentation of this code ?

In main.go

//Todo find to simplify this section
config.bloomskyURL = viper.GetString("BloomskyURL")
config.bloomskyAccessToken = viper.GetString("BloomskyAccessToken")
config.influxDBDatabase = viper.GetString("InfluxDBDatabase")
config.influxDBPassword = viper.GetString("InfluxDBPassword")
config.influxDBServer = viper.GetString("InfluxDBServer")
config.influxDBServerPort = viper.GetString("InfluxDBServerPort")
config.influxDBUsername = viper.GetString("InfluxDBUsername")
config.consoleActivated = viper.GetBool("ConsoleActivated")
config.influxDBActivated = viper.GetBool("InfluxDBActivated")
config.refreshTimer = time.Duration(viper.GetInt("RefreshTimer")) * time.Second
config.hTTPActivated = viper.GetBool("HTTPActivated")
config.hTTPPort = viper.GetString("HTTPPort")
config.logLevel = viper.GetString("LogLevel")
config.mock = viper.GetBool("mock")
config.language = viper.GetString("language")
config.dev = viper.GetBool("dev")
@patrickalin
Copy link
Owner Author

patrickalin commented Jun 28, 2017

Je vois dans just for func qu'il fait une map avec un for et n'utilise pas une structure ....
Je ne sais pas ce qui est mieux.
Avoir une structure ou passer constament une map.

https://www.youtube.com/watch?v=MnbMWNR_XZc
12:26

Si c'est utilisé qu'une fois pour créer un client(token) autant utiliser une map, il a raison.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants