<p><pre><code> log.Print("Missing argument for files direcory, Exiting...")
os.Exit(0)
</code></pre>
Exit code 0 is usually used for success. This is clearly an error.<p><pre><code> filePath + "/" + file.Name()
</code></pre>
There's path/filepath module for cross-platform joining of file paths.<p>Don't use defer f.Close() in the loop — defer will execute after the function returns. What you're doing is opening all of the files in the directory and then closing them only when the program exists.<p><pre><code> if file.IsDir() == false {
</code></pre>
Already boolean, this should be<p><pre><code> if !file.IsDir() {
</code></pre>
Apart from all of this, it looks like the algorithm is very inefficient with all of those slice manipulations.