embedding

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2021 License: MIT Imports: 7 Imported by: 0

README

go-code-embedding Actions Status

A tool to embed Go source code into binary using go:embed.

Usage

  1. Install go-code-embedding.
  2. Execute go-code-embedding command at your repository.
$ go-code-embedding --pkg PACKAGE_NAME

You can find code_embedding.go in your repository. So, your Go program get {show,list,restore}-code options.

List code

list-codes list your code.

$ my-app --list-codes
app.go
my-app/main.go
Show code

show-code show your code.

$ my-app --show-code my-app/main.go
package main

func main() {
    my-app.Do()
}
Restore code

restore-codes restore your code.

$ my-app --restore-codes

You also specify output path by --restore-path option.

Generated code dependency

Generated code (code_embedding.go) doesn't depend on your code, only provides {show,list,restore}-code options at init() function.

Installation

$ go install github.com/monochromegane/go-code-embedding/cmd/go-code-embedding@latest

Contribution

  1. Fork it
  2. Create a feature branch
  3. Commit your changes
  4. Rebase your local changes against the master branch
  5. Run test suite with the go test ./... command and confirm that it passes
  6. Run gofmt -s
  7. Create new Pull Request

License

MIT

Author

monochromegane

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(pkg, outputDir string) error

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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