Copilot commented on code in PR #86:
URL:
https://github.com/apache/dubbo-go-pixiu-samples/pull/86#discussion_r2249502190
##########
.github/workflows/github-actions.yml:
##########
@@ -78,10 +77,11 @@ jobs:
else
go get -v -t -d ./...
fi
+ go install github.com/dubbogo/tools/cmd/imports-formatter@latest
- - name: Go Fmt
+ - name: Format Code
run: |
- go fmt ./... && git status && [[ -z `git status -s` ]]
+ go fmt ./... && GOROOT=$(go env GOROOT) imports-formatter && git
status && [[ -z `git status -s` ]]
Review Comment:
The command combines multiple operations in a single line making it hard to
debug if one step fails. Consider breaking this into separate steps or adding
error handling between commands.
```suggestion
set -e
go fmt ./...
GOROOT=$(go env GOROOT) imports-formatter
git status
if [[ -n $(git status -s) ]]; then
echo "Unformatted files detected. Please run 'go fmt' and
'imports-formatter'."
exit 1
fi
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]