Skip to content

Commit

Permalink
Update 33974-add-public-lockedfile-pkg.md
Browse files Browse the repository at this point in the history
add new func
  • Loading branch information
azr committed Nov 8, 2019
1 parent 3a99c89 commit 9b55e8f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions design/33974-add-public-lockedfile-pkg.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ func Create(name string) (*File, error)
// The associated file descriptor has mode O_RDWR and the file is write-locked.
func Edit(name string) (*File, error)
// Transform invokes t with the result of reading the named file, with its lock
// still held.
//
// If t returns a nil error, Transform then writes the returned contents back to
// the file, making a best effort to preserve existing contents on error.
//
// t must not modify the slice passed to it.
func Transform(name string, t func([]byte) ([]byte, error)) (err error) {
// Open is like os.Open, but returns a read-locked file.
func Open(name string) (*File, error)
Expand Down

0 comments on commit 9b55e8f

Please sign in to comment.