MCPcopy 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
30func 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

mainFunction · 0.85

Calls 2

PrintlnMethod · 0.80
CloseMethod · 0.80

Tested by

no test coverage detected