]> Cypherpunks.ru repositories - gotai64n.git/blobdiff - tai64n.go
Fix failing when non-TAI64N strings are met
[gotai64n.git] / tai64n.go
index 34a63d185c2c1e351d1920394ed6bca71c7667b4..473c7e8083e66db6c9118f2956dce816c29ba798 100644 (file)
--- a/tai64n.go
+++ b/tai64n.go
@@ -1,6 +1,6 @@
 /*
 go.cypherpunks.ru/tai64n -- Pure Go TAI64N implementation
-Copyright (C) 2020 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2020-2021 Sergey Matveev <stargrave@stargrave.org>
 
 This program is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -33,9 +33,9 @@ const (
 
 type TAI64N [Size]byte
 
-func FromTime(t time.Time, tai *TAI64N) {
-       binary.BigEndian.PutUint64(tai[:], uint64(Base)+uint64(t.Unix()))
-       binary.BigEndian.PutUint32(tai[8:], uint32(t.Nanosecond()))
+func FromTime(src time.Time, dst *TAI64N) {
+       binary.BigEndian.PutUint64(dst[:], uint64(Base)+uint64(src.Unix()))
+       binary.BigEndian.PutUint32(dst[8:], uint32(src.Nanosecond()))
 }
 
 func ToTime(tai []byte) time.Time {