]> git.lizzy.rs Git - micro.git/commitdiff
Close file properly in clean and update makefile
authorZachary Yedidia <zyedidia@gmail.com>
Sat, 27 Jun 2020 21:55:01 +0000 (17:55 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Sat, 27 Jun 2020 21:55:01 +0000 (17:55 -0400)
Makefile
cmd/micro/clean.go

index 2f03e9aec04e22d0904afd68839ec232fa592091..19badb914bc95f228d3a9b298977c332221b90c2 100644 (file)
--- 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
index c2574dcaefd6564a7c4e1179d0a2b8ca6e9029fb..6ec5455f5ae303ea740c5ce5968c60935a42e9aa 100644 (file)
@@ -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()
                        }
                }