...

Source file src/github.com/pelletier/go-toml/v2/cmd/gotoml-test-encoder/gotoml-test-encoder.go

Documentation: github.com/pelletier/go-toml/v2/cmd/gotoml-test-encoder

     1  package main
     2  
     3  import (
     4  	"flag"
     5  	"log"
     6  	"os"
     7  	"path"
     8  
     9  	"github.com/pelletier/go-toml/v2/internal/testsuite"
    10  )
    11  
    12  func main() {
    13  	log.SetFlags(0)
    14  	flag.Usage = usage
    15  	flag.Parse()
    16  	if flag.NArg() != 0 {
    17  		flag.Usage()
    18  	}
    19  
    20  	err := testsuite.EncodeStdin()
    21  	if err != nil {
    22  		log.Fatal(err)
    23  	}
    24  }
    25  
    26  func usage() {
    27  	log.Printf("Usage: %s < toml-file\n", path.Base(os.Args[0]))
    28  	flag.PrintDefaults()
    29  	os.Exit(1)
    30  }
    31  

View as plain text