go-snapshot

command module
v0.0.0-...-9cae16b Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: MIT Imports: 11 Imported by: 0

README

go-snapshot

Simple asset file generator for Golang. No recursion, no file system interface, no restore. Just generates a big map from a compressed byte array based on the globs you provide.

How To Install

Make sure your GOPATH is set, then run go get to retrieve the package.

go get github.com/kode4food/go-snapshot

How To Use

Once you've installed the package, you can run it from GOPATH/bin like so:

go-snapshot -pkg assets -out ./assets/snapshot.go dir1/*.md dir2/*.lisp

The generated file exposes a few functions for accessing your assets:

// AssetNames returns a sorted string array of the stored asset names
a := assets.AssetNames()

// Get returns an asset as a byte array, and a bool found flag
b, ok := assets.Get("dir1/some_file.md")

// MustGet returns an asset as a byte array, or panics if not found
b := assets.MustGet("dir1/some_file.md")

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