cdf737027b
By running `go mod tidy -go=1.16`, we also automatically convert the "legacy" build tag syntax to use the new Go 1.17 compatible variant.
18 lines
413 B
Go
18 lines
413 B
Go
// Copyright (c) 2013-2014 The btcsuite developers
|
|
// Use of this source code is governed by an ISC
|
|
// license that can be found in the LICENSE file.
|
|
|
|
//go:build !windows && !plan9
|
|
// +build !windows,!plan9
|
|
|
|
package rename
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// Atomic provides an atomic file rename. newpath is replaced if it
|
|
// already exists.
|
|
func Atomic(oldpath, newpath string) error {
|
|
return os.Rename(oldpath, newpath)
|
|
}
|