foomo / gocontemplate

A code generation helper

Home Page:https://www.foomo.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Go Contemplate

Build Status Go Report Card GoDoc

A code generation helper.

Wrapper library around golang.org/x/tools/go/packages to filter only defined types and their dependencies.

Example

package main

import (
  "github.com/foomo/gocontemplate/pkg/contemplate"
)

func main() {
  ctpl, err := contemplate.Load(&contemplate.Config{
    Packages: []*contemplate.PackageConfig{
      {
        Path:  "github.com/foomo/sesamy-go/event",
        Types: []string{"PageView"},
      },
    },
  })
  if err != nil {
    panic(err)
  }
}

How to Contribute

Make a pull request...

License

Distributed under MIT License, please see license file within the code for more details.

About

A code generation helper

https://www.foomo.org

License:MIT License


Languages

Language:Go 82.7%Language:Makefile 13.2%Language:Shell 4.1%