Last active
January 15, 2019 15:14
-
-
Save liamsi/01729f51259f912b0dd64e686025eaee to your computer and use it in GitHub Desktop.
Custom marshaller
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
package main | |
import ( | |
"fmt" | |
"github.com/tendermint/go-amino" | |
) | |
type HelloType struct { | |
} | |
func (h HelloType) MarshalAmino() ([]byte, error) { | |
return []byte("Hello World"), nil | |
} | |
func main() { | |
cdc := amino.NewCodec() | |
bz, _ := cdc.MarshalBinaryBare(HelloType{}) | |
fmt.Println(string(bz)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment