Command gencodec generates marshaling methods for Go struct types.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gencodec/vendor/github.com/garslo/gogen/declare_and_assign.go

19 lines
296 B

package gogen
import (
"go/ast"
"go/token"
)
type DeclareAndAssign struct {
Lhs Expression
Rhs Expression
}
func (me DeclareAndAssign) Statement() ast.Stmt {
return &ast.AssignStmt{
Tok: token.DEFINE,
Lhs: []ast.Expr{me.Lhs.Expression()},
Rhs: []ast.Expr{me.Rhs.Expression()},
}
}