Created
May 27, 2025 19:29
-
-
Save codahale/7b236a6743c1ae409e2daec38a2c3762 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// createFile creates a file in the given root and returns it with a defer to close it | |
func createFile(root *os.Root, filename string) (*os.File, error) { | |
f, err := root.Create(filename) | |
if err != nil { | |
return nil, err | |
} | |
return f, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment