The cause of the problem is still a mysterium. I think it is added by Go but I cannot confirm it. But a quick fix is to add a line to the CSS that removes the spaces.
Yes you are right. You donât have to close the output file but you should at least make sure the output buffer is flushed before you read data from it(the file).
Youâll notice that an os.File doesnât have a .Flush () because it doesnât need one because it isnât buffered. Writes to it are direct syscalls to write to the file.
If thatâs true then why do they have a sync function for os?
Sync commits the current contents of the file to stable storage. Typically, this means flushing the file systemâs in-memory copy of recently written data to disk.
Direct file access is an â â â â â â â , what is implemented as an unbuffered stream in the language might be buffered at the kernel or filesystem driver.
Still the language canât do anything as the interface with the kernel ist unbuffered.
I thought I was explicit. Use the Sync method to flush the output buffer.
func (f *File) Sync() error
Sync commits the current contents of the file to stable storage. Typically, this means flushing the file systemâs in-memory copy of recently written data to disk.