You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
1. Read 'Effective Go' documentation
2. get into example
f, err := os.Open(name, os.O_RDONLY, 0)
if err != nil {
return err
}
d, err := f.Stat()
if err != nil {
return err
}
codeUsing(f, d)
3. The following documentation says nothing about the fate of fd 'f'.
What is the expected output?
The document clearly explains that the fd opened with os.Open() is garbage
collected. If it is not, then example should be fixed to close 'f' before
returning.
What do you see instead?
no explanation.