I want to open a txt file using the set default text editor application, but I don't know where Windows stores applications and files Format association. For example, in Unix-like systems, there is a command variable called $EDITOR that stores the path to the default editor.
I did a lot of research but didn't find anything
Thanks in Advance
I figured out how to open a file in windows using the default application. All you need to do is open the file yourself. Take a look at the example below.
exec.Command("cmd", "/c", "sample.txt")
The above is the detailed content of Open txt file using default windows text editor in golang. For more information, please follow other related articles on the PHP Chinese website!