code: func CleanPath(path string) string {
  	// http://stackoverflow.com/questions/17609732/expand-tilde-to-home-directory
  	if len(path) > 1 && path[:2] == "~/" {
  		usr, _ := user.Current()
  		dir := usr.HomeDir
  		path = strings.Replace(path, "~/", dir+"/", 1)
  	}
  	if p, err := filepath.Abs(path); err == nil {
  		return p
  	}
  	return filepath.Clean(path)
  }
docs: // CleanPath resolves common aliases in a path and cleans it as much as possible