Skip to content

Commit

Permalink
add custom types for [3]byte{},[5]byte{},[15]byte{},[17]byte{}
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-li committed Oct 2, 2024
1 parent c25508a commit a6aa680
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/tests/serialization/mod/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ type (
String string

Bytes []byte
Bytes3 [3]byte
Bytes4 [4]byte
Bytes5 [5]byte
Bytes15 [15]byte
Bytes16 [16]byte
Bytes17 [17]byte

SliceInt16 []int16
SliceInt16R []*int16
Expand Down Expand Up @@ -90,10 +94,18 @@ func customType(i interface{}) interface{} {
return String(v)
case []byte:
return Bytes(v)
case [3]byte:
return Bytes3(v)
case [4]byte:
return Bytes4(v)
case [5]byte:
return Bytes5(v)
case [15]byte:
return Bytes15(v)
case [16]byte:
return Bytes16(v)
case [17]byte:
return Bytes17(v)
case []int16:
return SliceInt16(v)
case []*int16:
Expand Down

0 comments on commit a6aa680

Please sign in to comment.