goatee

command module
v0.0.0-...-070c78e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2014 License: BSD-3-Clause Imports: 7 Imported by: 0

README

Goatee

A tool to generate .go files from .got templates. Can be used to embed abitrary blobs of data from other files in Go source files.

Installation

Install Goatee using the go get command:

 $ go get github.com/hjr265/goatee

The only dependency is the Go distribution itself.

Usage

Create a .got template, and, may be, name it hello.got

package main

import (
	"fmt"
)

func main() {
	fmt.Println({{string "greeting.txt"}})
}

Create a file named greeting.txt in the same directory

Hello, world!

Execute Goatee

$ goatee hello.got

This will generate the following as hello.go

package main

import (
	"fmt"
)

func main() {
	fmt.Println("Hello, world!")
}

Right now, there is the template function string, which reads a file and echos the content as a string literal; and then there is bytes, which reads the file and echos the content as an array of bytes.

Documentation

Contributing

Contributions are welcome.

License

Goatee is available under the BSD (3-Clause) License.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL