hcl: Fix the simple example in the README

This commit is contained in:
Mark Foster 2020-02-02 19:56:51 -08:00 committed by Martin Atkins
parent 9603bea74b
commit b41530cb36

View File

@ -33,11 +33,25 @@ package main
import ( import (
"log" "log"
"github.com/hashicorp/hcl/v2/hclsimple" "github.com/hashicorp/hcl/v2/hclsimple"
) )
type Config struct { type Config struct {
LogLevel string `hcl:"log_level"` IOMode string `hcl:"io_mode"`
Service ServiceConfig `hcl:"service,block"`
}
type ServiceConfig struct {
Protocol string `hcl:"protocol,label"`
Type string `hcl:"type,label"`
ListenAddr string `hcl:"listen_addr"`
Processes []ProcessConfig `hcl:"process,block"`
}
type ProcessConfig struct {
Type string `hcl:"type,label"`
Command []string `hcl:"command"`
} }
func main() { func main() {