mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-08-06 17:40:58 +00:00
21 lines
316 B
Go
21 lines
316 B
Go
|
// Copyright 2025 The Forgejo Authors
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
package testutils
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"os"
|
||
|
)
|
||
|
|
||
|
func FileExists(pathname string) (bool, error) {
|
||
|
_, err := os.Stat(pathname)
|
||
|
if errors.Is(err, os.ErrNotExist) {
|
||
|
return false, nil
|
||
|
}
|
||
|
if err != nil {
|
||
|
return false, err
|
||
|
}
|
||
|
return true, nil
|
||
|
}
|