Golang中path包和filepath包使用方法

path path實現了對斜槓"/"分隔的路徑的實用操做函數。linux path.Base --獲取文件名 func Base(path string) string Base函數返回路徑的最後一個元素。在提取元素前會求掉末尾的斜槓。若是路徑是"",會返回".";若是路徑是隻有一個斜杆構成,會返回"/"。web 例:fmt.Println(path.Base("http://www.baidu.
相關文章
相關標籤/搜索