Thanks to visit codestin.com
Credit goes to github.com

Skip to content

./pkg/archive: clean up Stat_t assertion#8863

Merged
tiborvass merged 1 commit into
moby:masterfrom
vbatts:vbatts-archive_stat
Nov 4, 2014
Merged

./pkg/archive: clean up Stat_t assertion#8863
tiborvass merged 1 commit into
moby:masterfrom
vbatts:vbatts-archive_stat

Conversation

@vbatts

@vbatts vbatts commented Oct 30, 2014

Copy link
Copy Markdown
Contributor

@vbatts

vbatts commented Oct 30, 2014

Copy link
Copy Markdown
Contributor Author

@tiborvass @unclejack

Comment thread pkg/archive/archive.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the point of changing single if to switch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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. :-\

@LK4D4

LK4D4 commented Oct 30, 2014

Copy link
Copy Markdown
Contributor

Shouldn't we return error on all other types? Just to see exact error when it will be not Stat_t.

@vbatts vbatts force-pushed the vbatts-archive_stat branch from 81486bd to 09e5942 Compare October 30, 2014 18:29
@vbatts

vbatts commented Oct 30, 2014

Copy link
Copy Markdown
Contributor Author

@LK4D4 that seems drastic. Since Sys() returns an interface{}, I'll log it for collection and review.

@LK4D4

LK4D4 commented Oct 30, 2014

Copy link
Copy Markdown
Contributor

@vbatts Ah, okay, this is only for hardlinks, so not so important.

@tonistiigi

Copy link
Copy Markdown
Member

@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.

@vbatts vbatts force-pushed the vbatts-archive_stat branch from 09e5942 to 5e02468 Compare October 30, 2014 20:51
@vbatts

vbatts commented Oct 30, 2014

Copy link
Copy Markdown
Contributor Author

after looking at the Sys() for other platforms, we can figure out switches when needed. I've updated now, and not logged unknown.

@tonistiigi

Copy link
Copy Markdown
Member

@vbatts LGTM

@vieux

vieux commented Oct 30, 2014

Copy link
Copy Markdown
Contributor

LGTM

2 similar comments
@jessfraz

Copy link
Copy Markdown
Contributor

LGTM

@tiborvass

Copy link
Copy Markdown
Contributor

LGTM

tiborvass added a commit that referenced this pull request Nov 4, 2014
./pkg/archive: clean up Stat_t assertion
@tiborvass tiborvass merged commit 54d6d12 into moby:master Nov 4, 2014
@vbatts vbatts deleted the vbatts-archive_stat branch April 27, 2016 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants