-
-
Notifications
You must be signed in to change notification settings - Fork 62
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 typed list #47 #48
Conversation
I have a question. If i try to get FileList and one of the files opening fails. What is the best way to process it? |
That’s a good question. Generally I think yes to both would be a good approach. Though it may not fit every use case, but would probably be fine to do just that. For graceful closure of files - if we didn’t touch them it won’t be necessary as it won’t affect files anyhow. It only would become an issue if files were open for writing and the application wrote some bytes to it. So while is a good practice - may not be such a strict requirement I think. |
If we go deeper (dicaprio.jpg) ... the situation of using several File / FileList arguments is unpleasant. If one of them fails to open, we get set of opened and not opened files. Of course, this will be a problem only if the program does not exit. |
@@ -511,13 +605,13 @@ func TestFileSimple1(t *testing.T) { | |||
t.Errorf("Test %s failed with error: %s", t.Name(), err.Error()) | |||
return | |||
} | |||
defer file1.Close() | |||
|
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.
Please leave 1 empty line between logical blocks for better readability. Too dense code is very hard to read
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.
ok
Hello!
Added typed lists.
One type and tests for it per commit.
List now called from the StringList