Skip to content

Commit

Permalink
Uint128: export Endianness field
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed Feb 1, 2022
1 parent c15d9aa commit 88c42ef
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions u128.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ import (
"strings"
)

// uint128
// Uint128
type Uint128 struct {
Lo uint64
Hi uint64
endianness binary.ByteOrder
Endianness binary.ByteOrder
}

func NewUint128BigEndian() *Uint128 {
return &Uint128{
endianness: binary.BigEndian,
Endianness: binary.BigEndian,
}
}

func NewUint128LittleEndian() *Uint128 {
return &Uint128{
endianness: binary.LittleEndian,
Endianness: binary.LittleEndian,
}
}

func (i Uint128) getByteOrder() binary.ByteOrder {
if i.endianness == nil {
if i.Endianness == nil {
return defaultByteOrder
}
return i.endianness
return i.Endianness
}

func (i Int128) getByteOrder() binary.ByteOrder {
Expand Down

0 comments on commit 88c42ef

Please sign in to comment.