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
1 changed files with 15 additions and 1 deletions

View File

@ -33,11 +33,25 @@ package main
import (
"log"
"github.com/hashicorp/hcl/v2/hclsimple"
)
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() {