From 47ef416835ad5b438ecf347fa96c93e90e2c4c89 Mon Sep 17 00:00:00 2001 From: Manfred Touron Date: Tue, 2 May 2017 11:50:37 +0200 Subject: [PATCH] Remove Environment as we already have `env` and `expandenv` filters from sprig --- Makefile | 4 ++-- encoder.go | 2 -- examples/dummy/output/export.json | 35 +++++-------------------------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index a6251f8..7d3f9f6 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,13 @@ .PHONY: build build: - go build -o protoc-gen-gotemplate . + go build -v -i -o protoc-gen-gotemplate . .PHONY: install install: go install . .PHONY: test -test: build +test: install cd examples/import && make cd examples/dummy && make cd examples/flow && make diff --git a/encoder.go b/encoder.go index 2e37120..9de53e9 100644 --- a/encoder.go +++ b/encoder.go @@ -34,7 +34,6 @@ type Ast struct { Filename string `json:"filename"` TemplateDir string `json:"template-dir"` Service *descriptor.ServiceDescriptorProto `json:"service"` - Environment []string `json:"environment"` } func NewGenericServiceTemplateBasedEncoder(templateDir string, service *descriptor.ServiceDescriptorProto, file *descriptor.FileDescriptorProto, debug bool, destinationDir string) (e *GenericTemplateBasedEncoder) { @@ -117,7 +116,6 @@ func (e *GenericTemplateBasedEncoder) genAst(templateFilename string) (*Ast, err DestinationDir: e.destinationDir, RawFilename: templateFilename, Filename: "", - Environment: os.Environ(), Service: e.service, } buffer := new(bytes.Buffer) diff --git a/examples/dummy/output/export.json b/examples/dummy/output/export.json index 58366e2..47a574d 100644 --- a/examples/dummy/output/export.json +++ b/examples/dummy/output/export.json @@ -1,9 +1,8 @@ { - "build-date": "2017-03-31T17:59:35.936239356+02:00", - "build-hostname": "Valerios-MacBook-Pro.local", - "build-user": "vgheri", - "go-pwd": "github.com/moul/protoc-gen-gotemplate/examples/dummy", - "pwd": "/Users/vgheri/go/src/github.com/moul/protoc-gen-gotemplate/examples/dummy", + "build-date": "2017-05-02T11:50:25.063291628+02:00", + "build-hostname": "manfred-spacegray.local", + "build-user": "moul", + "pwd": "/Users/moul/Git/moul/protoc-gen-gotemplate/examples/dummy", "debug": false, "destination-dir": ".", "file": { @@ -840,29 +839,5 @@ "options": {} } ] - }, - "environment": [ - "TERM_PROGRAM=platformio-ide-terminal", - "TERM=xterm-256color", - "SHELL=/bin/bash", - "MAKEFLAGS=", - "TMPDIR=/var/folders/9v/4b6h7ftd5ldfqv7gr82mbj340000gn/T/", - "Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.Zt6NPL5gZZ/Render", - "USER=vgheri", - "SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.UvxCW75B4v/Listeners", - "__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0", - "MAKELEVEL=2", - "MFLAGS=", - "PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/usr/local/go/bin:/usr/local/protoc/bin:/Users/vgheri/go/bin:/usr/local/protoc/bin:/Users/vgheri/go/bin", - "_=/usr/local/protoc/bin/protoc", - "PWD=/Users/vgheri/go/src/github.com/moul/protoc-gen-gotemplate/examples/dummy", - "LANG=en_US.UTF-8", - "XPC_FLAGS=0x0", - "XPC_SERVICE_NAME=0", - "HISTCONTROL=ignoreboth:erasedups", - "SHLVL=15", - "HOME=/Users/vgheri", - "LOGNAME=vgheri", - "GOPATH=/Users/vgheri/go" - ] + } } \ No newline at end of file