Refactor: unexport config.Config var & move login tasks to task module #288
No reviewers
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#288
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "6543/tea:unexport-ConfigVar"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Only access config.Config throu functions.
this make sure config is initialiced when accessing it
you can call it a follow up of #285
@noerw I had this in mind ;)
this prevent race condidtions & make sure if someone func read something from config, it's loaded
Refactor: unexport config.Config Varto Refactor: unexport config.Config var & move login tasks to task module@ -49,0 +66,4 @@
}
loginExist := false
for i := range config.Logins {
Why not use
GetLoginByName()
here?because we have to itterate and set Default=false to all others
we could switch to a hashmap ... but this need some more refactoring
ah, got it
@ -52,1 +83,4 @@
// GetLoginByName get login by name (case insensitive)
func GetLoginByName(name string) *Login {
err := loadConfig()
We reload config file for each function call now, can we avoid this?
Oh never mind, just saw the
once
-change in loadConfig ?@noerw changed a bit more since your last review - so here's the ping ;)
still good with me