Skip to content

An agnostic tool to create `*.go` sources (and other text) given some template(s) - generic types made easy.

License

Notifications You must be signed in to change notification settings

GoLangsam/dotgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotgo

An agnostic tool to create *.go sources (and other text) given some template(s) - generic types made easy.

Software License Go Report Card Build Status GoDoc

Simplicity ain't easy

Many weeks were spent in order to come up with a tool named dotgo which is easy to use.

And: dotgo offers a simple yet powerful way to generate go sources in particular (and other kinds of texts in general).

2017-07-12

Today github invites us to Join GitHub in support of the open internet, again.

This is important to us, as is Open Software.

As are Freedom and Transparency. And we love to contribute, and to share. Thus:

Today dotgo goes public here - in the hope it shall become useful to the community.

Please be patient

As of this writing - some refactoring is still under way in order to achive this, and in order to improve explanations and examples.

( Note: a couple of days ago, an example of what can be achieved was already published here )

More will follow soon - Thank You for Your patience!

Basic Usage

Imagine, You have Your templates and definitions in place. (We'll show You later, how to achieve this with ease.),

dotgo just needs to know:

  • the template(s) to be used
  • the location for resulting output file(s).

Thus, a simple

dotgo templates-dir target-dir

will do. Or - if these are same, and You already went there, use

dotgo .

and the magic shall happen.

Hint: It's use is intentionally kept so super-simple in order to allow ease of use, e.g. in Your source files, with the generate tool and it's workflow.

Remarks

dotgo uses text/template

dotgo builds heavily on the text/template package from the standard library. For reasons to be shared later elswhere.

dottxt - currently: No Need

And, as it's 'go awarness' can be switched off, there is currently no need for a twin such as dottxt. (This may change, if we feel need to add awarness for go specific stuff such as packages or vendoring. If so, there shall be a plain vanilla dottxt - also useful e.g. for *.md)

dothtml - coming soon

Now -as You might now- the standard library provides a second template package: html/template. Even so being isomorphic, it has other benefits when applied to xml/html. Thus, soon after having dotgo public and stable, there shall be it's companion dothtml - just using the other package.

same name - different meanings

When I chose the name dotgo I was not aware of the website dotgo.eu and it's related events. Please accepty my apologies if this creates any kind of confusion in Your mind. And Yes - I may deserve blames and flames not having taken time to research the name beforehand ...


Your suggestions, remarks, questions and/or contributions are welcome ;-)


Think deep - code happy - be simple - see clear :-)


Support on Beerpay

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay

About

An agnostic tool to create `*.go` sources (and other text) given some template(s) - generic types made easy.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages