Skip to content

Commit 7086fbd

Browse files
committed
minor changes
1 parent 8300aef commit 7086fbd

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

examples/caller/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package main
22

33
import (
44
"context"
5-
"fmt"
65
"log"
76

87
"github.com/vedhavyas/go-wasm"
@@ -59,7 +58,7 @@ func main() {
5958
if err != nil {
6059
panic(err)
6160
}
62-
fmt.Println(bytes)
61+
log.Println(bytes)
6362

6463
res, err = b.CallFunc("getError", nil)
6564
if err != nil {
@@ -71,5 +70,5 @@ func main() {
7170
panic(err)
7271
}
7372

74-
fmt.Println(verr)
73+
log.Println(verr)
7574
}

imports.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ func nanotime(ctx unsafe.Pointer, sp int32) {
7272
func walltime(ctx unsafe.Pointer, sp int32) {
7373
b := getBridge(ctx)
7474
t := time.Now().UnixNano()
75-
nanos := t % 1000000000
76-
b.setInt64(sp+8, t/1000000000)
75+
nanos := t % int64(time.Second)
76+
b.setInt64(sp+8, t/int64(time.Second))
7777
b.setInt32(sp+16, int32(nanos))
7878

7979
}

0 commit comments

Comments
 (0)