Q: Golang os.Rename(,) not working in Windows Using Go - lang, according to the documentation, the os.Rename should be able to rename either a file or directory on any operating system.
On Linux it works as it should, pass either a file or directory into it and the file or directory are moved.
On windows i recieve an 'Access is denied' Error when trying to pass a folder. 
 It works 100% for files.
example:
source = c:\sourcefolder
destination = c:\destinationfolder
source contains:
C:\sourcefolder\file1.xml
C:\sourcefolder\file2.xml
C:\sourcefolder\foldername1
C:\sourcefolder\foldername1\file3.xml
C:\sourcefolder\foldername2
C:\sourcefolder\foldername2\file4.xml
both file1.xml and file2.xml will successfully copy to c:\destination.
But the folders and files within the folders crash out with access denied
The script is pretty simple:
source := "C:\\sourcefolder"
destination := "C:\\destinationfolder"
pathSeperator := "\\"

files, err := ioutil.ReadDir(source)
    if err != nil {
    fmt.Println("Move command execution error: ", err)
    }

for _, f := range files {
    fmt.Println(f.Name())
    fmt.Println(f.Mode())
    err := os.Rename(source+pathSeperator+f.Name(), destination+pathSeperator+f.Name())
    if err != nil {
    fmt.Println("Move command execution error: ", err)
    panic(err)
    }
}

Having searched stackoverflow and golang's resources, i found the issue listed in 2016 that reported this fault and according to the issue it was fixed, but i am unable to get this to work. Nowhere else that i can find lists this issue go golang.
checking the f.Mode for access, i get drwxrwxrwx and have complete access to all the files and directories.
Any help with this would be great, racking my mind.  Thank you.

A: Quoted from comment. solved my issue.

Found the cause of the fault to be, if a windows explorer window is
  open and has ANY visibility of the folders being moved (i.e. in the
  tree on the left or right-pane) then access is denied as it can not
  move the folders. If i minimize all the tree's so that the
  source\destination folders are not visible and select a different sub
  folder in windows explorer then the os.Rename works as it should,
  moving all content from A to B really quick (as per linux)


A: I had the same issue with copying files within the same folder. The following solution works just fine (without closing or minimizing windows):
// read original file
origFile, _:= os.ReadFile(filePath)

// create new file with a different name
newFile, _ := os.Create(filePath + ".new")

// print data from original file to new file.
fmt.Fprintf(newFile, "%s", string(origFile))

