package server import ( "net" "gopkg.in/natefinch/npipe.v2" ) func (sh *ServerHandlers) Listen() (net.Listener, error) { ln, err := npipe.Listen(`\\.\pipe\` + sh.addr) if err != nil { // handle error } return ln, err }