Skip to content

Commit

Permalink
Renmae FileStat Stat
Browse files Browse the repository at this point in the history
  • Loading branch information
satotake authored and bep committed Aug 6, 2018
1 parent c362634 commit d40116e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tpl/os/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func init() {
},
)

ns.AddMethodMapping(ctx.FileStat,
ns.AddMethodMapping(ctx.Stat,
[]string{"fileStat"},
[][2]string{
{`{{ (fileStat "files/README.txt").Size }}`, `11`},
Expand Down
4 changes: 2 additions & 2 deletions tpl/os/os.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ func (ns *Namespace) FileExists(i interface{}) (bool, error) {
return status, nil
}

// FileStat Stat returns the os.FileInfo structure describing file.
func (ns *Namespace) FileStat(i interface{}) (_os.FileInfo, error) {
// Stat returns the os.FileInfo structure describing file.
func (ns *Namespace) Stat(i interface{}) (_os.FileInfo, error) {
path, err := cast.ToStringE(i)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions tpl/os/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func TestFileExists(t *testing.T) {
}
}

func TestFileStat(t *testing.T) {
func TestStat(t *testing.T) {
t.Parallel()

workingDir := "/home/hugo"
Expand All @@ -122,7 +122,7 @@ func TestFileStat(t *testing.T) {
{"", nil},
} {
errMsg := fmt.Sprintf("[%d] %v", i, test)
result, err := ns.FileStat(test.filename)
result, err := ns.Stat(test.filename)

if test.expect == nil {
require.Error(t, err, errMsg)
Expand Down

0 comments on commit d40116e

Please sign in to comment.