Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Putting main pkg in cmd subdirectory #264

Merged
merged 1 commit into from
Apr 18, 2018
Merged

Conversation

hairyhenderson
Copy link
Owner

@hairyhenderson hairyhenderson commented Feb 19, 2018

Fixes #147.

This moves the main package into the cmd/gomplate subdirectory, and adds a new gomplate package, so that gomplate can be used programmatically from other Go programs, like so:

package main

import "github.com/hairyhenderson/gomplate"

func main() {
	conf := &gomplate.Config{
		InputDir:    "in/",
		OutputDir:   "out/",
	}
	gomplate.RunTemplates(conf)
}

I also unexported some structs that weren't really exported (due to being in main), and have no business being exported. This'll give some flexibility to change things without breaking others.

Signed-off-by: Dave Henderson [email protected]

@hairyhenderson hairyhenderson force-pushed the move-main-to-cmd-pkg branch 2 times, most recently from d588e74 to 3a31719 Compare April 18, 2018 18:04
@hairyhenderson hairyhenderson changed the title [WIP] Putting main pkg in cmd subdirectory Putting main pkg in cmd subdirectory Apr 18, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Signed-off-by: Dave Henderson <[email protected]>
@hairyhenderson hairyhenderson merged commit 2aea441 into master Apr 18, 2018
@hairyhenderson hairyhenderson deleted the move-main-to-cmd-pkg branch April 18, 2018 19:30
@sean-
Copy link

sean- commented Apr 18, 2018

This is fantastic, thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants