Fixed minor errors reported by the analyzer.

This commit is contained in:
Leonid Nikitin 2024-01-31 21:22:38 +06:00
parent 6358d5d8cc
commit f09dd01b6d
Signed by: kor-elf
GPG Key ID: 7DE8F80C5CEC2C0D
3 changed files with 12 additions and 13 deletions

View File

@ -135,15 +135,15 @@ func (h ConvertorHandler) checkingFFPath() bool {
return true
}
type progress struct {
type Progress struct {
totalDuration float64
progressbar *widget.ProgressBar
protocol string
localizerService localizer.ServiceContract
}
func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService localizer.ServiceContract) progress {
return progress{
func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService localizer.ServiceContract) Progress {
return Progress{
totalDuration: totalDuration,
progressbar: progressbar,
protocol: "pipe:",
@ -151,11 +151,11 @@ func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localiz
}
}
func (p progress) GetProtocole() string {
func (p Progress) GetProtocole() string {
return p.protocol
}
func (p progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error {
func (p Progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error {
isProcessCompleted := false
var errorText string

View File

@ -61,7 +61,7 @@ func (h MenuHandler) GetMainMenu() *fyne.MainMenu {
func (h MenuHandler) LanguageSelection() {
h.localizerView.LanguageSelection(func(lang localizer.Lang) {
h.localizerRepository.Save(lang.Code)
_, _ = h.localizerRepository.Save(lang.Code)
h.menuMessageReload()
h.convertorHandler.MainConvertor()
})

View File

@ -68,12 +68,12 @@ func initLanguages(directory string, bundle *i18n.Bundle) ([]Lang, error) {
return nil, err
}
for _, file := range files {
language, err := bundle.LoadMessageFile(file)
lang, err := bundle.LoadMessageFile(file)
if err != nil {
return nil, err
}
title := cases.Title(language.Tag).String(display.Self.Name(language.Tag))
languages = append(languages, Lang{Code: language.Tag.String(), Title: title})
title := cases.Title(lang.Tag).String(display.Self.Name(lang.Tag))
languages = append(languages, Lang{Code: lang.Tag.String(), Title: title})
}
sort.Sort(languagesSort(languages))
@ -103,13 +103,12 @@ func (s Service) SetCurrentLanguage(lang Lang) error {
}
func (s Service) SetCurrentLanguageByCode(code string) error {
language, err := language.Parse(code)
lang, err := language.Parse(code)
if err != nil {
return err
}
title := cases.Title(language).String(display.Self.Name(language))
lang := Lang{Code: language.String(), Title: title}
return s.SetCurrentLanguage(lang)
title := cases.Title(lang).String(display.Self.Name(lang))
return s.SetCurrentLanguage(Lang{Code: lang.String(), Title: title})
}
func (s Service) GetCurrentLanguage() *CurrentLanguage {