package main
import (
"fmt"
"path/filepath"
)
func main() {
ext := filepath.Ext("a.txt")
fmt.Println("ext:", ext)
}
Output
ext: .txt
package main
import (
"fmt"
"path/filepath"
)
func main() {
ext := filepath.Ext("a.txt")
fmt.Println("ext:", ext)
}
ext: .txt