Skip to content

Switch cmd/ to use constructor functions.#36962

Merged
techknowlogick merged 5 commits into
go-gitea:mainfrom
techknowlogick:constructor-functions
Mar 25, 2026
Merged

Switch cmd/ to use constructor functions.#36962
techknowlogick merged 5 commits into
go-gitea:mainfrom
techknowlogick:constructor-functions

Conversation

@techknowlogick
Copy link
Copy Markdown
Member

This is a step towards potentially splitting command groups into their own folders to clean up cmd/ as one folder for all cli commands. Returning fresh command instances will also aid in adding tests as you don't need to concern yourself with the whole command tree being one mutable variable.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 23, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 23, 2026
@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Mar 23, 2026
@bircni
Copy link
Copy Markdown
Member

bircni commented Mar 23, 2026

for me go test -count=1 -tags 'sqlite sqlite_unlock_notify' ./cmd -run 'TestCliCmdError|TestCliCmdBefore' fails :-(

@bircni
Copy link
Copy Markdown
Member

bircni commented Mar 23, 2026

sorry my fail :-(

Comment thread cmd/main_test.go Outdated
Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 25, 2026
@techknowlogick techknowlogick merged commit 435123f into go-gitea:main Mar 25, 2026
26 checks passed
@techknowlogick techknowlogick deleted the constructor-functions branch March 25, 2026 14:53
@GiteaBot GiteaBot added this to the 1.26.0 milestone Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants