Skip to content

Commit

Permalink
Fix static check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Albert221 committed Dec 8, 2023
1 parent 4178d14 commit 2f51a24
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmd/poe_options_selector.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func prefixFromTemplateFileName(templateFile string) (string, error) {

return "", errors.New(
"invalid template-arb-file. Should be a filename with prefix ending " +
"with an underscore followed by a valid BCP-47 locale.",
"with an underscore followed by a valid BCP-47 locale",
)
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/seed.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func runSeed(cmd *cobra.Command, args []string) error {
var b bytes.Buffer
flutterLocale, err := converter.Convert(&b)
if err != nil {
if errors.Is(err, arb2poe.NoTermsError) {
if errors.Is(err, arb2poe.ErrNoTerms) {
fileLog.Info("no terms to convert")
continue
}
Expand Down
7 changes: 4 additions & 3 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ func getVcsInfo() (revision, time string, modified bool, err error) {
}

for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
switch setting.Key {
case "vcs.revision":
revision = setting.Value
} else if setting.Key == "vcs.time" {
case "vcs.time":
time = setting.Value
} else if setting.Key == "vcs.modified" {
case "vcs.modified":
modified = setting.Value == "true"
}
}
Expand Down
4 changes: 2 additions & 2 deletions convert/arb2poe/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewConverter(input io.Reader, templateLocale flutter.Locale, termPrefix str
}
}

var NoTermsError = errors.New("no terms to convert")
var ErrNoTerms = errors.New("no terms to convert")

func (c *Converter) Convert(output io.Writer) (lang flutter.Locale, err error) {
lang, messages, err := parseARB(c.input)
Expand All @@ -47,7 +47,7 @@ func (c *Converter) Convert(output io.Writer) (lang flutter.Locale, err error) {
}

if len(poeTerms) == 0 {
return flutter.Locale{}, NoTermsError
return flutter.Locale{}, ErrNoTerms
}

err = json.NewEncoder(output).Encode(poeTerms)
Expand Down

0 comments on commit 2f51a24

Please sign in to comment.