You've already forked postgres_exporter
mirror of
https://github.com/prometheus-community/postgres_exporter.git
synced 2025-08-09 15:42:47 +03:00
This commit implements a massive refactor of the repository, and moves the build system over to use Mage (magefile.org) which should allow seamless building across multiple platforms.
17 lines
366 B
Go
17 lines
366 B
Go
package sh
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
// Rm removes the given file or directory even if non-empty. It will not return
|
|
// an error if the target doesn't exist, only if the target cannot be removed.
|
|
func Rm(path string) error {
|
|
err := os.RemoveAll(path)
|
|
if err == nil || os.IsNotExist(err) {
|
|
return nil
|
|
}
|
|
return fmt.Errorf(`failed to remove %s: %v`, path, err)
|
|
}
|