Skip to content

Commit 08a4cf6

Browse files
committed
update to meet satori's uuid new update
1 parent 712c46d commit 08a4cf6

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

aws-es-proxy.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,11 @@ func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
223223
}
224224

225225
if p.logtofile {
226-
requestID := fmt.Sprintf("%s", uuid.NewV4().String())
226+
227+
requestID, _ := uuid.NewV4()
227228

228229
reqStruct := &requestStruct{
229-
Requestid: requestID,
230+
Requestid: requestID.String(),
230231
Datetime: time.Now().Format("2006/01/02 15:04:05"),
231232
Remoteaddr: r.RemoteAddr,
232233
Requesturi: ep.RequestURI(),
@@ -237,7 +238,7 @@ func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
237238
}
238239

239240
respStruct := &responseStruct{
240-
Requestid: requestID,
241+
Requestid: requestID.String(),
241242
Body: string(body.Bytes()),
242243
}
243244

@@ -326,8 +327,10 @@ func main() {
326327
}
327328

328329
if p.logtofile {
329-
requestFname := fmt.Sprintf("request-%s.log", uuid.NewV4().String())
330-
responseFname := fmt.Sprintf("response-%s.log", uuid.NewV4().String())
330+
u1, _ := uuid.NewV4()
331+
u2, _ := uuid.NewV4()
332+
requestFname := fmt.Sprintf("request-%s.log", u1.String())
333+
responseFname := fmt.Sprintf("response-%s.log", u2.String())
331334

332335
if fileRequest, err = os.Create(requestFname); err != nil {
333336
log.Fatalln(err.Error())

cross-compile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION="0.7"
3+
VERSION="0.8"
44

55
rm -rf dist; mkdir -p dist
66
for GOOS in darwin linux windows; do

0 commit comments

Comments
 (0)