From 08a4cf698e63e91631943f0344b2002bf7cd3fa1 Mon Sep 17 00:00:00 2001 From: Muslim AbuTaha Date: Tue, 9 Jan 2018 23:28:53 +0200 Subject: [PATCH] update to meet satori's uuid new update --- aws-es-proxy.go | 13 ++++++++----- cross-compile.sh | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/aws-es-proxy.go b/aws-es-proxy.go index dc4f884e..4e47770a 100644 --- a/aws-es-proxy.go +++ b/aws-es-proxy.go @@ -223,10 +223,11 @@ func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { } if p.logtofile { - requestID := fmt.Sprintf("%s", uuid.NewV4().String()) + + requestID, _ := uuid.NewV4() reqStruct := &requestStruct{ - Requestid: requestID, + Requestid: requestID.String(), Datetime: time.Now().Format("2006/01/02 15:04:05"), Remoteaddr: r.RemoteAddr, Requesturi: ep.RequestURI(), @@ -237,7 +238,7 @@ func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) { } respStruct := &responseStruct{ - Requestid: requestID, + Requestid: requestID.String(), Body: string(body.Bytes()), } @@ -326,8 +327,10 @@ func main() { } if p.logtofile { - requestFname := fmt.Sprintf("request-%s.log", uuid.NewV4().String()) - responseFname := fmt.Sprintf("response-%s.log", uuid.NewV4().String()) + u1, _ := uuid.NewV4() + u2, _ := uuid.NewV4() + requestFname := fmt.Sprintf("request-%s.log", u1.String()) + responseFname := fmt.Sprintf("response-%s.log", u2.String()) if fileRequest, err = os.Create(requestFname); err != nil { log.Fatalln(err.Error()) diff --git a/cross-compile.sh b/cross-compile.sh index f4728cfb..2fd96641 100755 --- a/cross-compile.sh +++ b/cross-compile.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="0.7" +VERSION="0.8" rm -rf dist; mkdir -p dist for GOOS in darwin linux windows; do