An open API service indexing awesome lists of open source software.

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

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"
)
```