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

     1  package chmodhelper
     2  
     3  import (
     4  	"gitlab.com/evatix-go/core/chmodhelper/chmodins"
     5  	"gitlab.com/evatix-go/core/constants"
     6  )
     7  
     8  func ParseRwxInstructionToStringRwx(
     9  	rwxInstruction *chmodins.RwxOwnerGroupOther,
    10  	isIncludeHyphen bool,
    11  ) string {
    12  	if rwxInstruction == nil {
    13  		return constants.EmptyString
    14  	}
    15  
    16  	var hyphen string
    17  
    18  	if isIncludeHyphen {
    19  		hyphen = constants.Hyphen
    20  	}
    21  
    22  	compiled := hyphen +
    23  		rwxInstruction.Owner +
    24  		rwxInstruction.Group +
    25  		rwxInstruction.Other
    26  
    27  	return compiled
    28  }