gitlab.com/evatix-go/core@v1.3.55/cmd/main/pathStatTest01.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"gitlab.com/evatix-go/core/chmodhelper"
     7  )
     8  
     9  func pathStatTest01() {
    10  	files := currentPackageAllFiles()
    11  	first10 := files[:10]
    12  	first11 := append(first10, "/something-non-exist")
    13  
    14  	items := chmodhelper.GetPathExistStats(false, first11...)
    15  
    16  	fmt.Println(items)
    17  }
    18  
    19  func pathStatTest02() {
    20  	files := currentPackageAllFiles()
    21  	first10 := files[:10]
    22  	first11 := append(first10, "/something-non-exist")
    23  
    24  	items := chmodhelper.GetPathExistStats(false, first11...)
    25  
    26  	fmt.Println(items[0].NotExistError())
    27  	fmt.Println(items[0].NotADirError())
    28  	fmt.Println(items[0].NotAFileError())
    29  
    30  	fmt.Println("----------------")
    31  	last := len(first11) - 1
    32  	fmt.Println(items[last].NotExistError())
    33  	fmt.Println(items[last].NotADirError())
    34  	fmt.Println(items[last].NotAFileError())
    35  
    36  }