initial commits
							parent
							
								
									f338172829
								
							
						
					
					
						commit
						c54c73bc14
					
				|  | @ -0,0 +1,25 @@ | ||||||
|  | package raft | ||||||
|  | 
 | ||||||
|  | import ( | ||||||
|  | 	"io/fs" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | // fileName returns the file-name of an fs.File.
 | ||||||
|  | func fileName(file fs.File) (string, error) { | ||||||
|  | 
 | ||||||
|  | 	if nil == file { | ||||||
|  | 		return "", errNilFile | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	var fileinfo fs.FileInfo | ||||||
|  | 	{ | ||||||
|  | 		var err error | ||||||
|  | 
 | ||||||
|  | 		fileinfo, err = fileInfo(file) | ||||||
|  | 		if nil != err { | ||||||
|  | 			return "", err | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
|  | 	return fileinfo.Name(), nil | ||||||
|  | } | ||||||
		Loading…
	
		Reference in New Issue