From 3617e544c9e7d8674bcca6c1afb4dea6a0cdb8f2 Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 16 Feb 2020 13:04:43 +0100 Subject: [PATCH] run gofmt --- client.go | 28 ++++++++++++++-------------- main.go | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/client.go b/client.go index f0fb6eae..ae46be78 100644 --- a/client.go +++ b/client.go @@ -164,14 +164,14 @@ func (c *client) log(format string, args ...interface{}) { func (c *client) run() { defer func() { - if c.p.postScript != "" { - postScript := exec.Command(c.p.postScript) - err := postScript.Run() - if err != nil { - c.log("ERR: %s", err) - } - } - }() + if c.p.postScript != "" { + postScript := exec.Command(c.p.postScript) + err := postScript.Run() + if err != nil { + c.log("ERR: %s", err) + } + } + }() defer c.log("disconnected") @@ -187,12 +187,12 @@ func (c *client) run() { c.log("connected") if c.p.preScript != "" { - preScript := exec.Command(c.p.preScript) - err := preScript.Run() - if err != nil { - c.log("ERR: %s", err) - } - } + preScript := exec.Command(c.p.preScript) + err := preScript.Run() + if err != nil { + c.log("ERR: %s", err) + } + } for { req, err := c.conn.ReadRequest() diff --git a/main.go b/main.go index 6145116e..070833f8 100644 --- a/main.go +++ b/main.go @@ -54,7 +54,7 @@ type program struct { rtpPort int rtcpPort int publishKey string - preScript string + preScript string postScript string mutex sync.RWMutex rtspl *serverTcpListener @@ -112,8 +112,8 @@ func newProgram(protocolsStr string, rtspPort int, rtpPort int, rtcpPort int, pu if preScript != "" { if runtime.GOOS != "linux" { return nil, fmt.Errorf("connect script currenty supported only on Linux") - } else if !regexp.MustCompile(`(?m)^(.+)\/([^/]+)$`).MatchString(preScript) { - return nil, fmt.Errorf("connect script must be a valid path") + } else if !regexp.MustCompile(`(?m)^(.+)\/([^/]+)$`).MatchString(preScript) { + return nil, fmt.Errorf("connect script must be a valid path") } } @@ -121,7 +121,7 @@ func newProgram(protocolsStr string, rtspPort int, rtpPort int, rtcpPort int, pu if runtime.GOOS != "linux" { return nil, fmt.Errorf("disconnect script currently supported only on Linux") } else if !regexp.MustCompile(`(?m)^(.+)\/([^/]+)$`).MatchString(postScript) { - return nil, fmt.Errorf("disconnect script must be a valid path") + return nil, fmt.Errorf("disconnect script must be a valid path") } }