Files
Gogs/internal/osutil/error.go
ᴊᴏᴇ ᴄʜᴇɴ 59e9fa191b chore: remove all MIT license file headers (#8083)
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2026-01-08 19:32:15 -05:00

24 lines
363 B
Go

package osutil
import (
"os"
"gogs.io/gogs/internal/errutil"
)
var _ errutil.NotFound = (*Error)(nil)
// Error is a wrapper of an OS error, which handles not found.
type Error struct {
error
}
func (e Error) NotFound() bool {
return e.error == os.ErrNotExist
}
// NewError wraps given error.
func NewError(err error) error {
return Error{error: err}
}