gitlab.com/evatix-go/core@v1.3.55/chmodhelper/ParseRwxInstructionsToExecutors.go (about)

     1  package chmodhelper
     2  
     3  import "gitlab.com/evatix-go/core/chmodhelper/chmodins"
     4  
     5  func ParseRwxInstructionsToExecutors(
     6  	rwxInstructions []chmodins.RwxInstruction,
     7  ) (
     8  	*RwxInstructionExecutors, error,
     9  ) {
    10  	if rwxInstructions == nil {
    11  		return NewRwxInstructionExecutors(0), rwxInstructionNilErr
    12  	}
    13  
    14  	length := len(rwxInstructions)
    15  	executors := NewRwxInstructionExecutors(length)
    16  
    17  	if length == 0 {
    18  		return executors, nil
    19  	}
    20  
    21  	for _, instruction := range rwxInstructions {
    22  		executor, err := ParseRwxInstructionToExecutor(&instruction)
    23  
    24  		if err != nil {
    25  			return executors, err
    26  		}
    27  
    28  		executors.Add(executor)
    29  	}
    30  
    31  	return executors, nil
    32  }