You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/fs/atomic.go
+30-7Lines changed: 30 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ package fs
2
2
3
3
import (
4
4
"io"
5
+
"io/fs"
5
6
"os"
6
7
"path"
7
8
@@ -15,19 +16,39 @@ type AtomicWriter struct {
15
16
16
17
var_ io.WriteCloser=&AtomicWriter{}
17
18
19
+
// NewAtomicWriter returns an io.WriteCloser that will write contents to a temp file and move that temp file to the destination filename. If the destination
20
+
// filename already exists, this constructor will copy the file to <filename>-old, truncating that file if it already exists.
0 commit comments