-
Notifications
You must be signed in to change notification settings - Fork 36
Use goimports instead of gofmt #214
Use goimports instead of gofmt #214
Conversation
43f0601
to
cb46cff
Compare
Codecov Report
@@ Coverage Diff @@
## master #214 +/- ##
============================================
- Coverage 72.40% 72.36% -0.04%
+ Complexity 1289 1288 -1
============================================
Files 139 139
Lines 6073 6073
Branches 469 469
============================================
- Hits 4397 4395 -2
- Misses 1464 1465 +1
- Partials 212 213 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
goimports fixes imports order and also formats like gofmt.
cb46cff
to
138cced
Compare
No functional change in this commit. I just formatted using goimports tool instead of gofmt tool. |
@@ -39,18 +39,20 @@ jobs: | |||
- name: Check out AD CLI | |||
uses: actions/checkout@v2 | |||
|
|||
- name: gofmt | |||
run: gofmt -s -w . | |||
- name: Format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After format, where is the formatted code located? I thought the workflow machine have the formatted code. How does it connect with the pull request and the master branch code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go provides tool to format source code. We have to manually run this tool on source code to format before merging the code. Developers can forget to format . This check will run the format and update the code if it is not run by the developer. In next step, i have check whether working directory is dirty or not, if so then developer forgot to run and this will return with error.
So you format the code manually or by workflow? |
We have to format manually by using this tool ( goimports). Workflow will check if formatting is not done by developer, it will exit with error. |
goimports fixes imports order and also formats like gofmt.
goimports fixes imports order and also formats like gofmt.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.