gen

command
v0.0.0-...-77dcbbd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

gen generates encoding/decoding codes for struct using "fieldNumber" tag. Below example will generate corresponding encoding/decoding functions.

Example:

//go:generate go run github.com/LiskHQ/lisk-engine/pkg/codec/gen

type Transaction struct {
	ID              codec.Hex
	size            int
	Module          string      `fieldNumber:"1"`
	Command         string      `fieldNumber:"2"`
	Nonce           uint64      `fieldNumber:"3"`
	Fee             uint64      `fieldNumber:"4"`
	SenderPublicKey codec.Hex   `fieldNumber:"5"`
	Params          codec.Hex   `fieldNumber:"6"`
	Signatures      []codec.Hex `fieldNumber:"7"`
}

Directories

Path Synopsis
Code generated for package internal by go-bindata DO NOT EDIT.
Code generated for package internal by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL