./pkg/archive: clean up Stat_t assertion#8863
Conversation
There was a problem hiding this comment.
What the point of changing single if to switch?
There was a problem hiding this comment.
@LK4D4 no particular point, except that syscall.Stat_t are starting to bug me on how pervasive they are and as we add additional platforms we'll need a clean standard way to do the type assertions on os.FileInfo.Sys(), and switches do that better. That was my train of thought, though for a single case, I guess it looks silly. :-\
|
Shouldn't we return error on all other types? Just to see exact error when it will be not |
81486bd to
09e5942
Compare
|
@LK4D4 that seems drastic. Since |
|
@vbatts Ah, okay, this is only for hardlinks, so not so important. |
|
@vbatts I dont' think that even the logging is important. For example in windows where I guess this never exists you don't want to log that for every file added to the context. Just avoid the nil dereference. |
inspired by @tonistiigi comment (https://github.com/docker/docker/pull/8046/files#r19579960) Signed-off-by: Vincent Batts <[email protected]>
09e5942 to
5e02468
Compare
|
after looking at the Sys() for other platforms, we can figure out switches when needed. I've updated now, and not logged unknown. |
|
@vbatts LGTM |
|
LGTM |
2 similar comments
|
LGTM |
|
LGTM |
./pkg/archive: clean up Stat_t assertion
inspired by @tonistiigi comment
(https://github.com/docker/docker/pull/8046/files#r19579960)
Signed-off-by: Vincent Batts [email protected]