You are correct in that the extension doesn't matter and the type of file is determined by the header. But you don't change the header, that can mess up the file. What you instead should change is the default application used to open that file type. You don't say what happens when you try to open the .go file, but when I open both an extensionless or a .go file it defaults to Gedit (simple text editor). If I right click that file and select Properties and then Open With I can set the default to vscode. Then double clicking the file opens it in vscode.
Windows works the same, except that it looks at the file extension instead of the file header to determine which program it should use. If the wrong program is used you can change the default on Windows as well.
Is there any way to set the default program for a group of "extensions" on Ubuntu?
I read what you suggested, but I can't tell if this is file or extension specific.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You are correct in that the extension doesn't matter and the type of file is determined by the header. But you don't change the header, that can mess up the file. What you instead should change is the default application used to open that file type. You don't say what happens when you try to open the .go file, but when I open both an extensionless or a
.go
file it defaults to Gedit (simple text editor). If I right click that file and selectProperties
and thenOpen With
I can set the default to vscode. Then double clicking the file opens it in vscode.Windows works the same, except that it looks at the file extension instead of the file header to determine which program it should use. If the wrong program is used you can change the default on Windows as well.
Is there any way to set the default program for a group of "extensions" on Ubuntu?
I read what you suggested, but I can't tell if this is file or extension specific.