From be4d186a46ac38d46b6c143783cc61c818c39f4f Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Sat, 27 Jun 2020 17:55:01 -0400 Subject: [PATCH] Close file properly in clean and update makefile --- Makefile | 3 ++- cmd/micro/clean.go | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 2f03e9ae..19badb91 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,8 @@ HASH = $(shell git rev-parse --short HEAD) DATE = $(shell GOOS=$(shell go env GOHOSTOS) GOARCH=$(shell go env GOHOSTARCH) \ go run tools/build-date.go) ADDITIONAL_GO_LINKER_FLAGS = $(shell GOOS=$(shell go env GOHOSTOS) \ - GOARCH=$(shell go env GOHOSTARCH)) + GOARCH=$(shell go env GOHOSTARCH) \ + go run tools/info-plist.go "$(VERSION)") GOBIN ?= $(shell go env GOPATH)/bin GOVARS = -X github.com/zyedidia/micro/v2/internal/util.Version=$(VERSION) -X github.com/zyedidia/micro/v2/internal/util.CommitHash=$(HASH) -X 'github.com/zyedidia/micro/v2/internal/util.CompileDate=$(DATE)' DEBUGVAR = -X github.com/zyedidia/micro/v2/internal/util.Debug=ON diff --git a/cmd/micro/clean.go b/cmd/micro/clean.go index c2574dca..6ec5455f 100644 --- a/cmd/micro/clean.go +++ b/cmd/micro/clean.go @@ -97,14 +97,13 @@ func CleanConfig() { file, e := os.Open(fname) if e == nil { - defer file.Close() - decoder := gob.NewDecoder(file) err = decoder.Decode(&buffer) if err != nil && f.Name() != "history" { badFiles = append(badFiles, fname) } + file.Close() } }