Skip to content

Latest commit

 

History

History
47 lines (32 loc) · 805 Bytes

README.md

File metadata and controls

47 lines (32 loc) · 805 Bytes

go-genslice

go-genslice is a cli tool to generate go slice code.

CI GoDev

Installation

go get -u github.com/paulvollmer/go-genslice

Usage

Sample input file

hello
world

Command to generate a string array:

go-genslice -d sample.txt -t string

The generated code result:

// Code generated by "go-genslice"; DO NOT EDIT.

package main

var Data = []string{
	`hello`, // 0
	`world`, // 1
}

License

MIT - See LICENSE file