title: Setting os.Mkdir permissions
body: <p>I'm trying to create directories with certain permissions using os.Mkdir but I cannot make it work, for some reason.</p>
  
  <p>My test program is:</p>
  
  <pre><code>package main
  
  import (
          "log"
          "os"
  )
  
  func main() {                 
      err := os.Mkdir("testdir", 0775)
      if err != nil {              
          log.Print(err)
      }
  }
  </code></pre>
  
  <p>However, the created directory has the default 0755 permissions:</p>
  
  <pre><code>drwxr-xr-x 2 user user 4096 Jan 10 10:14 testdir
  </code></pre>
  
  <p>A chmod from the shell works just fine, so I'm not sure why the Go program is not working.</p>