Skip to content

Commit 1d132d5

Browse files
committed
time: Use int64 instead of int as type of argument
1 parent 41fc468 commit 1d132d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/time/time.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ func parseTime(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple
112112
}
113113

114114
func fromTimestamp(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {
115-
var x int
115+
var x int64
116116
if err := starlark.UnpackPositionalArgs("from_timestamp", args, kwargs, 1, &x); err != nil {
117117
return nil, err
118118
}
119-
return Time(time.Unix(int64(x), 0)), nil
119+
return Time(time.Unix(x, 0)), nil
120120
}
121121

122122
func now(thread *starlark.Thread, _ *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error) {

0 commit comments

Comments
 (0)