Skip to content

Commit 6f6e1f5

Browse files
authored
fix(CLI): address additional checks introduced by golang 1.24 (#856)
1 parent f0c8a27 commit 6f6e1f5

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.github/workflows/test-cli.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
uses: actions/setup-go@v2
1818
with:
1919
go-version: '1.24.4'
20-
- name: Generate CLI
20+
- name: Generate CLI and run tests
2121
env:
2222
GOPRIVATE: github.com/phrase/phrase-go
2323
run: |
@@ -27,6 +27,7 @@ jobs:
2727
go mod edit -replace github.com/phrase/phrase-go/v4=../go
2828
npm run generate.cli
2929
go build .
30+
go test -v ./...
3031
- name: License check
3132
uses: phrase/actions/lawa-ci@v1
3233
with:

clients/cli/cmd/internal/init.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ func (cmd *InitCommand) configureSources() error {
308308

309309
err = paths.Validate(pushPath, cmd.FileFormat.ApiName, cmd.FileFormat.Extension)
310310
if err != nil {
311-
print.Failure(err.Error())
311+
print.Failure("%s", err.Error())
312312
} else {
313313
break
314314
}
@@ -339,7 +339,7 @@ func (cmd *InitCommand) configureTargets() error {
339339

340340
err = paths.Validate(pullPath, cmd.FileFormat.ApiName, cmd.FileFormat.Extension)
341341
if err != nil {
342-
print.Failure(err.Error())
342+
print.Failure("%s", err.Error())
343343
} else {
344344
break
345345
}
@@ -375,12 +375,12 @@ func (cmd *InitCommand) writeConfig() error {
375375
return err
376376
}
377377

378-
print.Success("We created the following configuration file for you: " + filename)
378+
print.Success("We created the following configuration file for you: %s", filename)
379379

380380
fmt.Println()
381381
fmt.Println(string(yamlBytes))
382382

383-
print.Success("For advanced configuration options, take a look at the documentation: " + shared.DocsConfigUrl)
383+
print.Success("For advanced configuration options, take a look at the documentation: %s", shared.DocsConfigUrl)
384384
print.Success("You can now use the push & pull commands in your workflow:")
385385
fmt.Println()
386386
fmt.Println("$ phrase push")

clients/cli/cmd/internal/push_source.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ func (source *Source) CheckPreconditions() error {
142142

143143
if len(duplicatedPlaceholders) > 0 {
144144
dups := strings.Join(duplicatedPlaceholders, ", ")
145-
return fmt.Errorf(fmt.Sprintf("%s can only occur once in a file pattern!", dups))
145+
return fmt.Errorf("%s can only occur once in a file pattern!", dups)
146146
}
147147

148148
return nil

0 commit comments

Comments
 (0)