Goโs os
and io/ioutil
packages provide simple ways to read from and write to files.
ioutil.WriteFile
writes bytes to a file, creating it if it doesnโt exist.0644
means read/write owner, read-only others.ioutil.ReadFile
reads entire file content as bytes.os
package.ioutil
, so you can also use os.WriteFile
and os.ReadFile
in newer versions.