github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/libgit/submodule_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 submoduleFileInfo struct {
    13  	name  string
    14  	size  int64
    15  	mtime time.Time
    16  	sf    *submoduleFile
    17  }
    18  
    19  var _ os.FileInfo = (*submoduleFileInfo)(nil)
    20  
    21  func (sfi *submoduleFileInfo) Name() string {
    22  	return sfi.name
    23  }
    24  
    25  func (sfi *submoduleFileInfo) Size() int64 {
    26  	return sfi.size
    27  }
    28  
    29  func (sfi *submoduleFileInfo) Mode() os.FileMode {
    30  	// Make it read-only.
    31  	return 0600
    32  }
    33  
    34  func (sfi *submoduleFileInfo) ModTime() time.Time {
    35  	return sfi.mtime
    36  }
    37  
    38  func (sfi *submoduleFileInfo) IsDir() bool {
    39  	return false
    40  }
    41  
    42  func (sfi *submoduleFileInfo) Sys() interface{} {
    43  	return nil
    44  }