github.com/amarpal/go-tools@v0.0.0-20240422043104-40142f59f616/internal/robustio/robustio_other.go (about)

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !windows && !darwin
     6  
     7  package robustio
     8  
     9  import (
    10  	"os"
    11  )
    12  
    13  func rename(oldpath, newpath string) error {
    14  	return os.Rename(oldpath, newpath)
    15  }
    16  
    17  func readFile(filename string) ([]byte, error) {
    18  	return os.ReadFile(filename)
    19  }
    20  
    21  func removeAll(path string) error {
    22  	return os.RemoveAll(path)
    23  }
    24  
    25  func isEphemeralError(err error) bool {
    26  	return false
    27  }