should use `defer output.Close()` right after `os.Create(..)` (so the file is closed even if e.g. Write fails etc.)