Skip to content

MTReload/vargen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vargen - generate variables from files

Installation:

go install github.com/mtreload/VariablesGenerator/cmd/vargen

Usage:

vargen -i input_file -o output_file [-p package_name]

Usage of vargen:
  -i string
        path to input file
  -o string
        path to output file
  -p string
        name of package to put into file
        Default is name of folder output file is stored

Capabilities

  • Generates string variable from file

Supported languages

  • Golang

Examples

vargen -i .\texts\a.txt -o .\generated\a.go 

./texts/a.txt:

Hello world!
"This is some text"

./generated/a.go

//This file is generated by vargen. Please, do not modify it.
package generated

    
var (

    A = "Hello world!\n\"This is some text\""

)

TODOs

  • Try on linux
  • Generate multiple input files into one output file
  • Support more languages
  • Refactor code