hanayo/startuato_windows.go

30 lines
418 B
Go
Raw Normal View History

2019-02-23 13:29:15 +00:00
// +build windows
package main
import (
"log"
"net"
"net/http"
"github.com/gin-gonic/gin"
)
var l net.Listener
func startuato(engine *gin.Engine) {
var err error
// Listen on a TCP or a UNIX domain socket (TCP here).
if config.Unix {
l, err = net.Listen("unix", config.ListenTo)
} else {
l, err = net.Listen("tcp", config.ListenTo)
}
if err != nil {
log.Fatalln(err)
}
http.Serve(l, engine)
}