func (lf *vswitchlogfile) RotateLogFolder() {
	for {
		time.Sleep(1 * time.Hour)
		if lf.logfile != nil {
			err := lf.logfile.Close()
			log.Println("[TOOLS][LOG] close logfile returned: ", err)
		}
		lf.SetLogFolder()
	}
}
rotates the log folder
package tools
import (
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"time"
)
type vswitchlogfile struct {
	filename string
	logfile  *os.File
	active   bool
}
var VSlogfile vswitchlogfile
func init() {
	var currentFolder = Hpwd()
	os.MkdirAll(filepath.Join(currentFolder, "logs"), 0755)
	VSlogfile.active = true
	VSlogfile.SetLogFolder()
	go VSlogfile.RotateLogFolder()
}