github.com/niedbalski/juju@v0.0.0-20190215020005-8ff100488e47/agent/tools/export_test.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package tools
     5  
     6  import (
     7  	"os"
     8  	"runtime"
     9  )
    10  
    11  func getDirPerm() os.FileMode {
    12  	// File permissions on windows yield different results then on Linux
    13  	// For example an os.FileMode of 0100 on a directory on Windows,
    14  	// will yield -r-xr-xr-x. os.FileMode of 0755 will yield -rwxrwxrwx
    15  	if runtime.GOOS == "windows" {
    16  		return os.FileMode(0777)
    17  	}
    18  	return os.FileMode(dirPerm)
    19  }
    20  
    21  var (
    22  	DirPerm = getDirPerm()
    23  )
    24  
    25  const (
    26  	ToolsFile      = toolsFile
    27  	GUIArchiveFile = guiArchiveFile
    28  )