func ReadFromRoot(file, trim string) []byte {
	_, caller, _, ok := runtime.Caller(0)
	if !ok {
		panic("No caller information")
	}
	caller = path.Dir(caller)
	callerDir := filepath.Dir(caller)
	projectRoot := strings.TrimRight(callerDir, trim)
	file = projectRoot + file
	fo, err := Open(file)
	if err != nil {
		log.Fatal(err)
	}
	fr, err := Read(fo)
	if err != nil {
		log.Fatal(err)
	}
	defer fo.Close()
	return fr
}
ReadFromRoot attempts to read data from a file relative to the parent of this func and the project root
the first argument is the file you want to read, relative to project root
the second argument is the path between the file you want to read, and the callers parent
Example: caller is 'project/pkg/files' and you want to read 'project/dir/somefile.xml'
ReadFromRoot("configs/somefile.xml", "pkg")
returns file data and error, if any
package files
import (
	"bufio"
	"io/ioutil"
	"log"
	"os"
	"path"
	"path/filepath"
	"runtime"
	"strings"
)
func IsExist(fn string) bool {
	_, err := os.Stat(fn)
	if os.IsNotExist(err) {
		return false
	}
	return true
}
func Create(fn string) (*os.File, error) {
	f, err := os.Create(fn)
	return f, err
}
func Open(file string) (*os.File, error) {
	f, err := os.Open(file)
	return f, err
}
func Read(file *os.File) ([]byte, error) {
	reader := bufio.NewReader(file)
	data, err := ioutil.ReadAll(reader)
	return data, err
}
func Write(f *os.File, data []byte) (int, error) {
	w, err := f.Write(data)
	return w, err
}