FAQ
…and for that to have been the design, it must be the case that automatically discarding the entity after the initial transaction would have been a general mistake, such as a file being closed automatically after an open, read, or write call. Since a file may well have future reads or writes long after the open, only the higher-level logic that called the open can know when to close. Same with like types and thus the truth is that the data “is not garbage until you say so” outright, via defer, or through some other means.


Michael Jones, CEO • michael@wearality.com • +1 650 656-6989
Wearality Corporation • 289 S. San Antonio Road • Los Altos, CA 94022
On Nov 15, 2015, at 2:51 AM, Kevin Malachowski wrote:

A good general rule is that if a type has a Close method you probably should call it when you're done with it.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 14, '15 at 4:26p
activeNov 15, '15 at 11:44a
posts4
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase