github.com/markusbkk/elvish@v0.0.0-20231204143114-91dc52438621/pkg/testutil/umask.go (about)

     1  package testutil
     2  
     3  // Umask sets the umask for the duration of the test, and restores it afterwards.
     4  func Umask(c Cleanuper, m int) {
     5  	save := umask(m)
     6  	c.Cleanup(func() { umask(save) })
     7  }