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 return true
} }
type progress struct { type Progress struct {
totalDuration float64 totalDuration float64
progressbar *widget.ProgressBar progressbar *widget.ProgressBar
protocol string protocol string
localizerService localizer.ServiceContract localizerService localizer.ServiceContract
} }
func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService localizer.ServiceContract) progress { func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService localizer.ServiceContract) Progress {
return progress{ return Progress{
totalDuration: totalDuration, totalDuration: totalDuration,
progressbar: progressbar, progressbar: progressbar,
protocol: "pipe:", 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 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 isProcessCompleted := false
var errorText string var errorText string

View File

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

View File

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