tomll: port to v2 (#727)

Fixes #721
This commit is contained in:
Thomas Pelletier
2021-12-31 15:40:18 -05:00
committed by GitHub
parent d8ddc00c61
commit 4807229e94
7 changed files with 245 additions and 15 deletions
+8 -3
View File
@@ -15,15 +15,20 @@ import (
"github.com/pelletier/go-toml/v2/internal/cli"
)
func main() {
usage := `tomljson can be used in two ways:
const usage = `tomljson can be used in two ways:
Reading from stdin:
cat file.toml | tomljson > file.json
Reading from a file:
tomljson file.toml > file.json
`
cli.Execute(usage, convert)
func main() {
p := cli.Program{
Usage: usage,
Fn: convert,
}
p.Execute()
}
func convert(r io.Reader, w io.Writer) error {