func CheckFileSource(fileName string) error {
	absFile, _ := filepath.Abs(fileName)
	prefixes := []string{"bin", "boot", "dev", "lib", "lib64", "proc", "sbin", "sys"}
	for _, prefix := range prefixes {
		if strings.HasPrefix(absFile, filepath.Join("/", prefix)) {
			return fmt.Errorf("Filename resolves to invalid path '%v'", absFile)
		}
	}
	return nil
}
CheckFileSource checks the filename is valid
package filecheck
import (
	"fmt"
	"path/filepath"
	"strings"
)