github.com/golang/dep@v0.5.4/analyzer_notwindows_test.go (about)

     1  // Copyright 2017 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // +build !windows
     6  
     7  package dep
     8  
     9  import (
    10  	"io"
    11  	"os"
    12  )
    13  
    14  func makeUnreadable(path string) (io.Closer, error) {
    15  	err := os.Chmod(path, 0222)
    16  	if err != nil {
    17  		return nil, err
    18  	}
    19  	return closer{}, nil
    20  }
    21  
    22  type closer struct{}
    23  
    24  func (closer) Close() error { return nil }