title: How to get an exclusive lock on a file in go
body: <p>How can I get an exclusive read access to a file in go? I have tried documentations from docs but I am still able to open the file in notepad and edit it. I want to deny any other process to have access to read and write while the first process has not closed it explicitly. In .NET I could do something as:</p>
  
  <pre><code>File.Open("a.txt", FileMode.Open, FileAccess.ReadWrite, FileShare.None);
  </code></pre>
  
  <p>How do I do it in go? </p>