Codebase list go-dep / c827bcb5-edb7-478f-9ae7-deff358cc990/main analyzer_notwindows_test.go
c827bcb5-edb7-478f-9ae7-deff358cc990/main

Tree @c827bcb5-edb7-478f-9ae7-deff358cc990/main (Download .tar.gz)

analyzer_notwindows_test.go @c827bcb5-edb7-478f-9ae7-deff358cc990/mainraw · history · blame

// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build !windows

package dep

import (
	"io"
	"os"
)

func makeUnreadable(path string) (io.Closer, error) {
	err := os.Chmod(path, 0222)
	if err != nil {
		return nil, err
	}
	return closer{}, nil
}

type closer struct{}

func (closer) Close() error { return nil }