Golang Checking file extension not working
<p>I want to get a file path from the console and check if the file is a vm file.
I wrote this code:</p>

<pre><code>func main() {
reader := bufio.NewReader(os.Stdin)
fmt.Println("Enter the path of the vm file:")
path, _ := reader.ReadString('\n')
if filepath.Ext(path) != ".vm" {
    fmt.Println("Error! file must be vm file")
}
</code></pre>

<p>but it's not working. I just started learn Go So please accept my apologies if this is a basic mistake.</p>