-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07f4823
commit 0784be4
Showing
3 changed files
with
140 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package main | ||
|
||
type GOBE_CUSTOM_TYPE interface { | ||
ZZMarshalGOBE(dst []byte) uint64 | ||
ZZUnmarshalGOBE(src []byte) (offset uint64, ok bool) | ||
ZZSizeGOBE() uint64 | ||
} | ||
|
||
type CustomUint8 uint8 | ||
|
||
var _ GOBE_CUSTOM_TYPE = (*CustomUint8)(nil) | ||
|
||
func (c *CustomUint8) ZZMarshalGOBE(dst []byte) uint64 { | ||
dst[0] = byte(*c) | ||
return 1 | ||
} | ||
|
||
func (c *CustomUint8) ZZUnmarshalGOBE(src []byte) (offset uint64, ok bool) { | ||
*c = CustomUint8(src[0]) | ||
return 1, true | ||
} | ||
|
||
func (c *CustomUint8) ZZSizeGOBE() uint64 { | ||
return 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.