Skip to content

CherkashinEvgeny/gogen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gogen

Code generation toolkit.

Library api is unstable. If you need stable api, you should fork this project or find an alternative one.

About The Project

Gogen - is golang code generation toolkit.

Toolkit consists of three parts:

  1. core provides core functions for code generation
  2. types integration with go/types package
  3. utils contains functions, that do not lead directly to code generation, but can help keep code concise

Features:

  • Reach code generation api
  • Embedded formatting
  • Autoimport

Usage

Hello world:

import (
	"fmt"
	. "github.com/CherkashinEvgeny/gogen"
)

func main() {
	mainFunc := Func("main", Sign(In(), Out()), Lines(
		Call(
			SmartQual("fmt", "fmt", "Println"),
			Val("Hello world(:"),
		),
	))
	pkg := Pkg("", "test", Imports(), mainFunc)
	fmt.Println(Stringify(pkg))
}

Underwater rocks

Similar projects

License

Retry is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

Contact

  • Email: cherkashin.evgeny.viktorovich@gmail.com
  • Telegram: @evgeny_cherkashin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages