github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/libgit/diff_file_info.go (about)

     1  // Copyright 2019 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package libgit
     6  
     7  import (
     8  	"os"
     9  	"time"
    10  )
    11  
    12  type diffFileInfo struct {
    13  	name  string
    14  	size  int64
    15  	mtime time.Time
    16  }
    17  
    18  var _ os.FileInfo = (*diffFileInfo)(nil)
    19  
    20  func (cfi *diffFileInfo) Name() string {
    21  	return cfi.name
    22  }
    23  
    24  func (cfi *diffFileInfo) Size() int64 {
    25  	return cfi.size
    26  }
    27  
    28  func (cfi *diffFileInfo) Mode() os.FileMode {
    29  	// Make it read-only.
    30  	return 0600
    31  }
    32  
    33  func (cfi *diffFileInfo) ModTime() time.Time {
    34  	return cfi.mtime
    35  }
    36  
    37  func (cfi *diffFileInfo) IsDir() bool {
    38  	return false
    39  }
    40  
    41  func (cfi *diffFileInfo) Sys() interface{} {
    42  	return nil
    43  }