gitlab.com/evatix-go/core@v1.3.55/coreutils/stringutil/MaskTrimLine.go (about)

     1  package stringutil
     2  
     3  import "strings"
     4  
     5  func MaskTrimLine(
     6  	mask,
     7  	line string,
     8  ) string {
     9  	line = strings.TrimSpace(line)
    10  
    11  	if line == "" {
    12  		return mask
    13  	}
    14  
    15  	if len(line) > len(mask) || len(mask) == 0 {
    16  		return line
    17  	}
    18  
    19  	return line + mask[len(line):]
    20  }