-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for internal/file/watch
#526
Conversation
Best reviewed: commit by commit
Optimal code review plan (2 warnings)
|
Codecov Report
@@ Coverage Diff @@
## master #526 +/- ##
==========================================
+ Coverage 7.84% 10.77% +2.93%
==========================================
Files 388 403 +15
Lines 19945 20939 +994
==========================================
+ Hits 1565 2257 +692
- Misses 18156 18414 +258
- Partials 224 268 +44
Continue to review full report at Codecov.
|
internal/file/watch
internal/file/watch
/rebase |
[REBASE] Rebase triggered by hlts2 for branch: test/internal/file_watch |
/rebase |
[REBASE] Rebase triggered by hlts2 for branch: test/internal/file_watch |
0ee7c66
to
dfe8b39
Compare
/rebase |
[REBASE] Rebase triggered by hlts2 for branch: test/internal/file_watch |
e462d65
to
d86811c
Compare
internal/file/watch
internal/file/watch
do we need author review for this PR? |
internal/file/watch
internal/file/watch
dirs := make([]string, 0, len(w.dirs)) | ||
for d := range w.dirs { | ||
dirs = append(dirs, d) | ||
} |
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.
let me tell about why, please?
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.
sure.
map type is reference type in golang.
so Even if we take the lock w.dirs, it changes when the referrer changes.
When we copy the value of w.dirs, the instantaneous state is copied, so even if the referrer changes, the copy is not affected.
iw, err := w.init() | ||
if err == nil { | ||
w = iw | ||
} |
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.
same. Please tell me the reason.
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.
sure.
if w.init returns error, w become nil.
and when roop continues, nil pointer exception will occur.
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.
LGTM
/rebase |
[REBASE] Rebase triggered by vankichi for branch: test/internal/file_watch |
2e950df
to
2ce46a0
Compare
[FORMAT] Updating license headers and formatting go codes triggered by vankichi. |
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.
[APPROVED] This PR is approved by vankichi.
@hlts2 |
/rebase |
[REBASE] Rebase triggered by vankichi for branch: test/internal/file_watch |
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
2ce46a0
to
df0bbbc
Compare
[FORMAT] Updating license headers and formatting go codes triggered by vankichi. |
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.
[APPROVED] This PR is approved by vankichi.
Signed-off-by: hlts2 hiroto.funakoshi.hiroto@gmail.com
Description:
I added test case for
internal/file/watch
Related Issue:
How Has This Been Tested?:
Environment:
Types of changes:
Changes to Core Features:
Checklist: