Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Go-Learning-Land/Go-Learning-Archive
/ closeFile
Function
closeFile
GolangBasics/GoByExample/044Defer.go:30–38 ·
view source on GitHub ↗
(f *os.File)
Source
from the content-addressed store, hash-verified
28
}
29
30
func
closeFile(f *os.File) {
31
fmt.Println(
"closing"
)
32
err := f.Close()
33
34
if
err != nil {
35
fmt.Fprintf(os.Stderr,
"error: %v\n"
, err)
36
os.Exit(1)
37
}
38
}
Callers
1
main
Function · 0.85
Calls
2
Println
Method · 0.80
Close
Method · 0.80
Tested by
no test coverage detected