go-genbuilder

command module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

gen-builder CI

A golang code generator tool to generate Builder pattern code.

Usage

Add a go:generate annotation to a struct

//go:generate go run github.com/paulvollmer/go-genbuilder
type Shape2D struct {
	Kind ShapeKind
	X    int
	Y    int
}

And then use the generated code to create a Shape2D instance.

shape := NewShape2DBuilder().
		SetKind("RECT").
		SetX(1).
		SetY(2).
		Build()

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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