aboutsummaryrefslogtreecommitdiffstats
path: root/utils/fs/os/os.go
diff options
context:
space:
mode:
authorPierre Guilleminot <pierre.guilleminot@gmail.com>2016-11-07 10:52:34 +0100
committerMáximo Cuadros <mcuadros@gmail.com>2016-11-07 10:52:34 +0100
commit1b2f95c971a2492f012db76bd49a948c2691c9bd (patch)
tree6102ba115180d87c14efa73b010491ec6f554ad5 /utils/fs/os/os.go
parent1da0de4423bcba9ff98c53f15cbf9cb8f11ebe27 (diff)
downloadgo-git-1b2f95c971a2492f012db76bd49a948c2691c9bd.tar.gz
utils/fs: Fix O_CREATE flag check in OpenFile (#116)
* utils/fs: Fix O_CREATE flag check in OpenFile * utils/fs/os: test that Open does not create dirs.
Diffstat (limited to 'utils/fs/os/os.go')
-rw-r--r--utils/fs/os/os.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/fs/os/os.go b/utils/fs/os/os.go
index 3ff825e..4f4e651 100644
--- a/utils/fs/os/os.go
+++ b/utils/fs/os/os.go
@@ -32,7 +32,7 @@ func (fs *OS) Create(filename string) (fs.File, error) {
func (fs *OS) OpenFile(filename string, flag int, perm os.FileMode) (fs.File, error) {
fullpath := path.Join(fs.base, filename)
- if flag|os.O_CREATE != 0 {
+ if flag&os.O_CREATE != 0 {
if err := fs.createDir(fullpath); err != nil {
return nil, err
}