Refactor: unexport config.Config var & move login tasks to task module #288

Merged
6543 merged 11 commits from 6543/tea:unexport-ConfigVar into master 2020-12-12 13:28:38 +00:00
Owner

Only access config.Config throu functions.

this make sure config is initialiced when accessing it

you can call it a follow up of #285

Only access config.Config throu functions. this make sure config is initialiced when accessing it you can call it a follow up of #285
6543 added this to the v0.6.0 milestone 2020-12-11 10:10:53 +00:00
6543 added the
kind
refactor
label 2020-12-11 10:10:53 +00:00
6543 added 5 commits 2020-12-11 10:10:54 +00:00
Author
Owner

@noerw I had this in mind ;)

@noerw I had this in mind ;)
6543 added 1 commit 2020-12-11 10:15:05 +00:00
make SetDefaultLogin() case insensitive
All checks were successful
continuous-integration/drone/pr Build is passing
1edeb6c272
6543 added 1 commit 2020-12-11 10:18:44 +00:00
update func descriptions
All checks were successful
continuous-integration/drone/pr Build is passing
01bddc385a
6543 added the
status/needs-reviews
label 2020-12-11 10:19:04 +00:00
Author
Owner

this prevent race condidtions & make sure if someone func read something from config, it's loaded

this prevent race condidtions & make sure if someone func read something from config, it's loaded
6543 changed title from Refactor: unexport config.Config Var to Refactor: unexport config.Config var & move login tasks to task module 2020-12-11 10:20:38 +00:00
noerw requested changes 2020-12-11 11:03:23 +00:00
Dismissed
@ -49,0 +66,4 @@
}
loginExist := false
for i := range config.Logins {
Member

Why not use GetLoginByName() here?

Why not use `GetLoginByName()` here?
Author
Owner

because we have to itterate and set Default=false to all others

we could switch to a hashmap ... but this need some more refactoring

because we have to itterate and set Default=false to all others we could switch to a hashmap ... but this need some more refactoring
Member

ah, got it

ah, got it
noerw marked this conversation as resolved
@ -52,1 +83,4 @@
// GetLoginByName get login by name (case insensitive)
func GetLoginByName(name string) *Login {
err := loadConfig()
Member

We reload config file for each function call now, can we avoid this?

We reload config file for each function call now, can we avoid this?
Member

Oh never mind, just saw the once-change in loadConfig ?

Oh never mind, just saw the `once`-change in loadConfig ?
noerw marked this conversation as resolved
noerw approved these changes 2020-12-11 12:22:52 +00:00
Dismissed
6543 added 1 commit 2020-12-11 13:46:12 +00:00
Merge branch 'master' into unexport-ConfigVar
All checks were successful
continuous-integration/drone/pr Build is passing
941cc3cf75
6543 added 1 commit 2020-12-11 13:55:34 +00:00
move FindSSHKey to task module
All checks were successful
continuous-integration/drone/pr Build is passing
7267cd0afb
6543 added 1 commit 2020-12-11 14:04:56 +00:00
split task/login into two
All checks were successful
continuous-integration/drone/pr Build is passing
b1285630ea
Author
Owner

@noerw changed a bit more since your last review - so here's the ping ;)

@noerw changed a bit more since your last review - so here's the ping ;)
noerw approved these changes 2020-12-11 14:57:14 +00:00
Dismissed
noerw left a comment
Member

still good with me

still good with me
6543 added 1 commit 2020-12-11 22:04:19 +00:00
Merge branch 'master' into unexport-ConfigVar
All checks were successful
continuous-integration/drone/pr Build is passing
d57ae37280
zeripath approved these changes 2020-12-12 13:26:00 +00:00
Dismissed
6543 removed the
status/needs-reviews
label 2020-12-12 13:27:46 +00:00
6543 merged commit c063329e9a into master 2020-12-12 13:28:38 +00:00
6543 deleted branch unexport-ConfigVar 2020-12-12 13:28:46 +00:00
Sign in to join this conversation.
No description provided.