refactor(yay): move cfg inside of runtime (#2259)

* rework relationship between runtime and cfg

* separate runtime from cfg

* simplify instantiation logic

* move installer to appropriate package

* move operator to sync package

* add tests for srcinfo service

* consolidate srcinfo service in sync

* add logger to srcinfo

* add logger to preparer

* remove unused text functions

* remove remaining text.* from srcinfo

* remove global logger parts

* remove global org method exports

* remove global logger

* move text->input

* add rule to prevent fmt.Print

* update golangci go version

* remove outdated FAQs

* remove outdated FAQs
This commit is contained in:
Jo
2023-08-06 21:39:41 +02:00
committed by GitHub
parent 7483393377
commit 8916cd174b
74 changed files with 1475 additions and 1367 deletions

View File

@@ -3,11 +3,12 @@ package main
import (
"context"
"errors"
"fmt"
"github.com/Jguer/aur"
"github.com/Jguer/votar/pkg/vote"
"github.com/leonelquinteros/gotext"
"github.com/Jguer/yay/v12/pkg/text"
)
type ErrAURVote struct {
@@ -20,7 +21,7 @@ func (e *ErrAURVote) Error() string {
}
func handlePackageVote(ctx context.Context,
targets []string, aurClient aur.QueryClient,
targets []string, aurClient aur.QueryClient, logger *text.Logger,
voteClient *vote.Client, upvote bool,
) error {
infos, err := aurClient.Get(ctx, &aur.Query{
@@ -32,7 +33,7 @@ func handlePackageVote(ctx context.Context,
}
if len(infos) == 0 {
fmt.Println(gotext.Get(" there is nothing to do"))
logger.Println(gotext.Get(" there is nothing to do"))
return nil
}