Expose environment

This commit is contained in:
Manfred Touron 2016-12-15 11:01:29 +01:00
parent 407790640d
commit 7907fb79d9
No known key found for this signature in database
GPG Key ID: 9CCF47DF1FD978A1

View File

@ -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)