有没有办法检测go中的命令是否有管道?
例:
cat test.txt | mygocommand #Piped, this is how it should be used
mygocommand # Not piped, this should be blocked
Run Code Online (Sandbox Code Playgroud)
我正在读斯坦丁reader := bufio.NewReader(os.Stdin).
我看到有16.581.375个环回地址,但几乎每个程序都只使用127.0.0.1。那么为什么会有这么多未使用的地址呢?
IPv4存在很多地址问题,那么为什么人们会浪费这么多IP地址呢?这是有原因的吗?