forked from forgejo/forgejo
[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)
* Update go-swagger * vendor
This commit is contained in:
parent
66843f2237
commit
3270e7a443
350 changed files with 26353 additions and 5552 deletions
26
vendor/github.com/spf13/afero/basepath.go
generated
vendored
26
vendor/github.com/spf13/afero/basepath.go
generated
vendored
|
@ -177,4 +177,30 @@ func (b *BasePathFs) LstatIfPossible(name string) (os.FileInfo, bool, error) {
|
|||
return fi, false, err
|
||||
}
|
||||
|
||||
func (b *BasePathFs) SymlinkIfPossible(oldname, newname string) error {
|
||||
oldname, err := b.RealPath(oldname)
|
||||
if err != nil {
|
||||
return &os.LinkError{Op: "symlink", Old: oldname, New: newname, Err: err}
|
||||
}
|
||||
newname, err = b.RealPath(newname)
|
||||
if err != nil {
|
||||
return &os.LinkError{Op: "symlink", Old: oldname, New: newname, Err: err}
|
||||
}
|
||||
if linker, ok := b.source.(Linker); ok {
|
||||
return linker.SymlinkIfPossible(oldname, newname)
|
||||
}
|
||||
return &os.LinkError{Op: "symlink", Old: oldname, New: newname, Err: ErrNoSymlink}
|
||||
}
|
||||
|
||||
func (b *BasePathFs) ReadlinkIfPossible(name string) (string, error) {
|
||||
name, err := b.RealPath(name)
|
||||
if err != nil {
|
||||
return "", &os.PathError{Op: "readlink", Path: name, Err: err}
|
||||
}
|
||||
if reader, ok := b.source.(LinkReader); ok {
|
||||
return reader.ReadlinkIfPossible(name)
|
||||
}
|
||||
return "", &os.PathError{Op: "readlink", Path: name, Err: ErrNoReadlink}
|
||||
}
|
||||
|
||||
// vim: ts=4 sw=4 noexpandtab nolist syn=go
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue