From c685e0696ab3842b88f841fc950801e35cb70b15 Mon Sep 17 00:00:00 2001 From: Nia Waldvogel Date: Sat, 25 Dec 2021 12:33:40 -0500 Subject: [PATCH] os: add Perm stub on Go 1.15 This adds a stub for Perm on Go 1.15, which allows the OS package to compile again. --- src/os/file_go_other.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/os/file_go_other.go b/src/os/file_go_other.go index 351de7ac..c03ff468 100644 --- a/src/os/file_go_other.go +++ b/src/os/file_go_other.go @@ -1,3 +1,4 @@ +//go:build !go1.16 // +build !go1.16 package os @@ -49,3 +50,8 @@ func (m FileMode) IsDir() bool { func (m FileMode) IsRegular() bool { return false } + +// Perm is a stub, always returning 0. +func (m FileMode) Perm() FileMode { + return 0 +}