@@ -454,7 +454,7 @@ func classIndex(class string) (int, error) {
454454
455455// lSetFileLabel sets the SELinux label for this path, not following symlinks,
456456// or returns an error.
457- func lSetFileLabel (fpath string , label string ) error {
457+ func lSetFileLabel (fpath , label string ) error {
458458 if fpath == "" {
459459 return ErrEmptyPath
460460 }
@@ -473,7 +473,7 @@ func lSetFileLabel(fpath string, label string) error {
473473
474474// setFileLabel sets the SELinux label for this path, following symlinks,
475475// or returns an error.
476- func setFileLabel (fpath string , label string ) error {
476+ func setFileLabel (fpath , label string ) error {
477477 if fpath == "" {
478478 return ErrEmptyPath
479479 }
@@ -566,7 +566,7 @@ func canonicalizeContext(val string) (string, error) {
566566
567567// computeCreateContext requests the type transition from source to target for
568568// class from the kernel.
569- func computeCreateContext (source string , target string , class string ) (string , error ) {
569+ func computeCreateContext (source , target , class string ) (string , error ) {
570570 classidx , err := classIndex (class )
571571 if err != nil {
572572 return "" , err
@@ -579,8 +579,7 @@ func computeCreateContext(source string, target string, class string) (string, e
579579func catsToBitset (cats string ) (* big.Int , error ) {
580580 bitset := new (big.Int )
581581
582- catlist := strings .Split (cats , "," )
583- for _ , r := range catlist {
582+ for r := range strings .SplitSeq (cats , "," ) {
584583 ranges := strings .SplitN (r , "." , 2 )
585584 if len (ranges ) > 1 {
586585 catstart , err := parseLevelItem (ranges [0 ], category )
@@ -788,7 +787,7 @@ func calculateGlbLub(sourceRange, targetRange string) (string, error) {
788787 return outrange .String (), nil
789788}
790789
791- func readWriteCon (fpath string , val string ) (string , error ) {
790+ func readWriteCon (fpath , val string ) (string , error ) {
792791 if fpath == "" {
793792 return "" , ErrEmptyPath
794793 }
@@ -1088,7 +1087,7 @@ func initContainerLabels() (string, string) {
10881087
10891088// containerLabels returns an allocated processLabel and fileLabel to be used for
10901089// container labeling by the calling process.
1091- func containerLabels () (processLabel string , fileLabel string ) {
1090+ func containerLabels () (processLabel , fileLabel string ) {
10921091 if ! getEnabled () {
10931092 return "" , ""
10941093 }
@@ -1155,7 +1154,7 @@ func copyLevel(src, dest string) (string, error) {
11551154// chcon changes the fpath file object to the SELinux label.
11561155// If fpath is a directory and recurse is true, then chcon walks the
11571156// directory tree setting the label.
1158- func chcon (fpath string , label string , recurse bool ) error {
1157+ func chcon (fpath , label string , recurse bool ) error {
11591158 if fpath == "" {
11601159 return ErrEmptyPath
11611160 }
0 commit comments