Path: blob/main/vendor/github.com/spf13/afero/internal/common/adapters.go
2893 views
// Copyright © 2022 Steve Francia <[email protected]>.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5// http://www.apache.org/licenses/LICENSE-2.06//7// Unless required by applicable law or agreed to in writing, software8// distributed under the License is distributed on an "AS IS" BASIS,9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.10// See the License for the specific language governing permissions and11// limitations under the License.1213package common1415import "io/fs"1617// FileInfoDirEntry provides an adapter from os.FileInfo to fs.DirEntry18type FileInfoDirEntry struct {19fs.FileInfo20}2122var _ fs.DirEntry = FileInfoDirEntry{}2324func (d FileInfoDirEntry) Type() fs.FileMode { return d.FileInfo.Mode().Type() }2526func (d FileInfoDirEntry) Info() (fs.FileInfo, error) { return d.FileInfo, nil }272829