From 7086fbdd29d3eba760b7fd03f29861f56051d01b Mon Sep 17 00:00:00 2001 From: vedhavyas Date: Thu, 22 Aug 2019 10:12:14 -0700 Subject: [PATCH] minor changes --- examples/caller/main.go | 5 ++--- imports.go | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/caller/main.go b/examples/caller/main.go index 16468ac..821ad9e 100644 --- a/examples/caller/main.go +++ b/examples/caller/main.go @@ -2,7 +2,6 @@ package main import ( "context" - "fmt" "log" "github.com/vedhavyas/go-wasm" @@ -59,7 +58,7 @@ func main() { if err != nil { panic(err) } - fmt.Println(bytes) + log.Println(bytes) res, err = b.CallFunc("getError", nil) if err != nil { @@ -71,5 +70,5 @@ func main() { panic(err) } - fmt.Println(verr) + log.Println(verr) } diff --git a/imports.go b/imports.go index 6b0d69b..bbac0ad 100644 --- a/imports.go +++ b/imports.go @@ -72,8 +72,8 @@ func nanotime(ctx unsafe.Pointer, sp int32) { func walltime(ctx unsafe.Pointer, sp int32) { b := getBridge(ctx) t := time.Now().UnixNano() - nanos := t % 1000000000 - b.setInt64(sp+8, t/1000000000) + nanos := t % int64(time.Second) + b.setInt64(sp+8, t/int64(time.Second)) b.setInt32(sp+16, int32(nanos)) }