https://github.com/bouk/file2const
Generates a Go file containing the given files as strings
https://github.com/bouk/file2const
Last synced: 8 months ago
JSON representation
Generates a Go file containing the given files as strings
- Host: GitHub
- URL: https://github.com/bouk/file2const
- Owner: bouk
- Created: 2015-04-01T17:58:48.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2016-06-21T17:21:22.000Z (almost 10 years ago)
- Last Synced: 2025-03-16T13:25:08.779Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# file2const
Generates a Go file containing the given files as strings. Useful for packaging in static files.
```
Usage: file2const []
-package="": name of package to give to file. Default to directory name
```
Given a file like follows:
```javascript
console.log("HEY")
```
This command: `file2const --package="example" file.js:value out.go`
Will write the following to out.go
```go
package example
const (
value = "console.log(\"HEY\")\n"
)
```