Named pipes in Go for Windows and Linux

I am new to Go, I want to create a named pipes implementation in Go that works on both Windows and Linux.

I managed to get code running on Ubuntu, but this one does not work on Windows

Does Go have no abstraction that allows you to work with Named Pipes in both environments?

Below is a snippet of my code

//to create pipe: does not work in windows syscall.Mkfifo("tmpPipe", 0666) // to open pipe to write file, err1 := os.OpenFile("tmpPipe", os.O_RDWR, os.ModeNamedPipe) //to open pipe to read file, err := os.OpenFile("tmpPipe", os.O_RDONLY, os.ModeNamedPipe) 

Any help or pointers would help a lot. thanks

+7
source share
2 answers

According to https://github.com/golang/go/issues/3599

The Nate package looks beautiful and anyone can get it.

Windows named pipe implementation written in pure Go:
https://github.com/natefinch/npipe

What inspired (Win32 IO-related utilities for Go):
https://github.com/Microsoft/go-winio

+8
source

There is an implementation of named pipes for Windows in Go from Microsoft:

https://github.com/Microsoft/go-winio

+2
source

All Articles