func ReadControllersFile(file string) (*Controllers, error) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		if os.IsNotExist(err) {
			return &Controllers{}, nil
		}
		if os.IsPermission(err) {
			u, userErr := utils.LocalUsername()
			if userErr != nil {
				return nil, err
			}
			if ok, fileErr := utils.IsFileOwner(file, u); fileErr == nil && !ok {
				err = errors.Annotatef(err, "ownership of the file is not the same as the current user")
			}
		}
		return nil, err
	}
	controllers, err := ParseControllers(data)
	if err != nil {
		return nil, err
	}
	return controllers, nil
}
// ReadControllersFile loads all controllers defined in a given file.
// If the file is not found, it is not an error.
ReadControllersFile loads all controllers defined in a given file.
If the file is not found, it is not an error.
// ReadControllersFile loads all controllers defined in a given file . // If the file is not found it is not an error .
func ReadControllersFile(file string) (*Controllers, error) {
	data, err := ioutil.ReadFile(file)
	if err != nil {
		if os.IsNotExist(err) {
			return &Controllers{}, nil
		}
		if os.IsPermission(err) {
			u, userErr := utils.LocalUsername()
			if userErr != nil {
				return nil, err
			}
			if ok, fileErr := utils.IsFileOwner(file, u); fileErr == nil && !ok {
				err = errors.Annotatef(err, "ownership of the file is not the same as the current user")
			}
		}
		return nil, err
	}
	controllers, err := ParseControllers(data)
	if err != nil {
		return nil, err
	}
	return controllers, nil
}
func ReadControllersFile ( file string ) ( * Controllers , error ) { data , err := ioutil . ReadFile ( file ) if err != nil { if os . IsNotExist ( err ) { return & Controllers { } , nil } if os . IsPermission ( err ) { u , userErr := utils . LocalUsername ( ) if userErr != nil { return nil , err } if ok , fileErr := utils . IsFileOwner ( file , u ) ; fileErr == nil && ! ok { err = errors . Annotatef ( err , " " ) } } return nil , err } controllers , err := ParseControllers ( data ) if err != nil { return nil , err } return controllers , nil }
ReadControllersFile loads all controllers defined in a given file.
ReadControllersFile loads all controllers defined in a given file .