From 7907fb79d9add30c35b20e5cafae138439b0d712 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Thu, 15 Dec 2016 11:01:29 +0100 Subject: [PATCH] Expose environment --- encoder.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/encoder.go b/encoder.go index 57d800a..4fb653d 100644 --- a/encoder.go +++ b/encoder.go @@ -33,6 +33,7 @@ type Ast struct { Filename string `json:"filename"` TemplateDir string `json:"template-dir"` Service *descriptor.ServiceDescriptorProto `json:"service"` + Environment []string `json:"environment"` } func NewGenericTemplateBasedEncoder(templateDir string, service *descriptor.ServiceDescriptorProto, file *descriptor.FileDescriptorProto, debug bool) (e *GenericTemplateBasedEncoder) { @@ -97,6 +98,7 @@ func (e *GenericTemplateBasedEncoder) genAst(templateFilename string) (*Ast, err TemplateDir: e.templateDir, RawFilename: templateFilename, Filename: "", + Environment: os.Environ(), Service: e.service, } buffer := new(bytes.Buffer)