From 67008be35f5432aeec06641540f3b6df3eac8747 Mon Sep 17 00:00:00 2001 From: "Ryan J. Yoder" Date: Mon, 16 Mar 2020 07:36:15 -0700 Subject: [PATCH] Unix Socket Handling (#2280) * do not set unix socket permissions. Cleanup unix socket. * removed useless error checking --- gin.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gin.go b/gin.go index 0244f18c..ab1d0a46 100644 --- a/gin.go +++ b/gin.go @@ -320,16 +320,13 @@ func (engine *Engine) RunUnix(file string) (err error) { debugPrint("Listening and serving HTTP on unix:/%s", file) defer func() { debugPrintError(err) }() - os.Remove(file) listener, err := net.Listen("unix", file) if err != nil { return } defer listener.Close() - err = os.Chmod(file, 0777) - if err != nil { - return - } + defer os.Remove(file) + err = http.Serve(listener, engine) return }