main.go 312 B

123456789101112131415161718192021
  1. package main
  2. import (
  3. "fmt"
  4. "net"
  5. "os"
  6. "time"
  7. )
  8. func main() {
  9. if len(os.Args) != 2 {
  10. fmt.Fprintln(os.Stderr, "usage: udsconnect <path>")
  11. os.Exit(2)
  12. }
  13. c, err := net.DialTimeout("unix", os.Args[1], 500*time.Millisecond)
  14. if err != nil {
  15. fmt.Fprintln(os.Stderr, err)
  16. os.Exit(1)
  17. }
  18. _ = c.Close()
  19. }