Skip to content

Commit

Permalink
Merge pull request #221 from pinkfish/patch-1
Browse files Browse the repository at this point in the history
Use isZero to check if a Time instance is initialized
  • Loading branch information
michaelklishin authored Sep 24, 2023
2 parents 97a7db0 + 4a77835 commit 831d90b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions write.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (f *heartbeatFrame) write(w io.Writer) (err error) {
// short short long long short remainder...
func (f *headerFrame) write(w io.Writer) (err error) {
var payload bytes.Buffer
var zeroTime time.Time

if err = binary.Write(&payload, binary.BigEndian, f.ClassId); err != nil {
return
Expand Down Expand Up @@ -118,7 +117,7 @@ func (f *headerFrame) write(w io.Writer) (err error) {
if len(f.Properties.MessageId) > 0 {
mask = mask | flagMessageId
}
if f.Properties.Timestamp != zeroTime {
if !f.Properties.Timestamp.IsZero() {
mask = mask | flagTimestamp
}
if len(f.Properties.Type) > 0 {
Expand Down

0 comments on commit 831d90b

Please sign in to comment.