/go-stubs

Easily create Go files from stub files

Primary LanguageGo

go-stubs

Easily create .go files from stub files in your projects.

Usage

go get github.com/nwby/go-stubs

Create a stub file:

package stubs

type {{.Model}} struct {
	
}

Define a StubDetails struct and then that stub using CreateStub:

stub := StubDetails{
    Name:        "./stubs/model.go.stub",
    FileName:    "model.go",
    Destination: "./",
    Values: map[string]string{
        "Model": "User",
    },
}

stub.CreateStub()