Improve code readability #1

+ Improved tests readability of common_utils_test.go
+ Fixed minor typos
This commit is contained in:
Mikołaj Pęczkowski 2024-06-13 21:19:04 +02:00
parent 8cd3ed2127
commit 68636d5e64
8 changed files with 167 additions and 123 deletions

View file

@ -61,18 +61,18 @@ func (g *GitRepositoryManager) Run(w io.Writer) int {
exitCode := 0
if len(g.cliArguments.LimitToTags) != 0 {
err := g.limitTags()
err := g.limitRepositoriesToTags()
if err != nil {
echo.ErrorfMsg(err.Error())
exitCode = 1
return 1
}
}
if g.cliArguments.LimitToName != "" {
err := g.limitName()
err := g.limitRepositoryToName()
if err != nil {
echo.ErrorfMsg(err.Error())
exitCode = 1
return 1
}
}
@ -108,7 +108,7 @@ func describeStatus(status commands.CommandStatus) {
}
}
func (g *GitRepositoryManager) limitTags() error {
func (g *GitRepositoryManager) limitRepositoriesToTags() error {
limitedTagsTmp := []config.RepositoryConfig{}
for _, item := range g.configuration.Repositories {
@ -123,7 +123,7 @@ func (g *GitRepositoryManager) limitTags() error {
return nil
}
func (g *GitRepositoryManager) limitName() error {
func (g *GitRepositoryManager) limitRepositoryToName() error {
for _, item := range g.configuration.Repositories {
if g.cliArguments.LimitToName == item.Name {
g.configuration.Repositories = []config.RepositoryConfig{item}