Skip to content

Commit

Permalink
Merge pull request #3 from wwwzbwcom/master
Browse files Browse the repository at this point in the history
feat: add wasm runtime support and go mod
  • Loading branch information
djherbis committed Apr 25, 2021
2 parents 2d56997 + 4c4823b commit ba95caf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
22 changes: 22 additions & 0 deletions atime_wasm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// http://golang.org/src/os/stat_js.go

package atime

import (
"os"
"syscall"
"time"
)

func timespecToTime(sec, nsec int64) time.Time {
return time.Unix(sec, nsec)
}

func atime(fi os.FileInfo) time.Time {
stat := fi.Sys().(*syscall.Stat_t)
return timespecToTime(stat.Atime, stat.AtimeNsec)
}
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/djherbis/atime

go 1.16

0 comments on commit ba95caf

Please sign in to comment.