Categorygithub.com/go-services/code
repositorypackage
0.1.11
Repository: https://github.com/go-services/code.git
Documentation: pkg.go.dev

# README

Code Go Report Card Coverage Status Build Status

Code is a small wrapper around jen that allows go-services to generate go code easier.

It has a very friendly api

package main

import (
    "github.com/go-services/code"
    "fmt"
)

func main() {
    structure := code.NewStruct("MyStruct")
    
    fmt.Println(structure) // 	type MyStruct struct{}

    structure.Fields = []code.StructField{
        code.NewStructField("Name", code.NewType("string")),
    }
    fmt.Println(structure)  // 	type MyStruct struct {
                            //  	Name string
                            //  }

}