From 6e8f5a08781442ed6525a76ba4fde43019cadb94 Mon Sep 17 00:00:00 2001 From: taoyuanyuan Date: Fri, 4 Jun 2021 14:55:22 +0800 Subject: [PATCH] modify file flag to O_WRONLY (#49) * modify file flag to O_WRONLY. * fix ci --- Makefile | 2 +- log/logger.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2bec5be..5a77e64 100644 --- a/Makefile +++ b/Makefile @@ -7,4 +7,4 @@ coverage-local: coverage: docker build --rm -t ${BUILD_IMAGE} build/contrib/builder/binary - docker run --rm -v $(GOPATH):/go -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} make coverage-local + docker run --rm -v $(shell go env GOPATH):/go -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} make coverage-local diff --git a/log/logger.go b/log/logger.go index 668e4f7..db2fe17 100644 --- a/log/logger.go +++ b/log/logger.go @@ -182,7 +182,7 @@ func (l *Logger) start() error { if err := os.MkdirAll(filepath.Dir(l.output), 0755); err != nil { return err } - file, err := os.OpenFile(l.output, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644) + file, err := os.OpenFile(l.output, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644) if err != nil { return err }