code: func setSocketTimeout(fd int, timeout time.Duration) error {
  	tv := syscall.NsecToTimeval(timeout.Nanoseconds())
  	for _, opt := range []int{syscall.SO_RCVTIMEO, syscall.SO_SNDTIMEO} {
  		if err := syscall.SetsockoptTimeval(fd, syscall.SOL_SOCKET, opt, &tv); err != nil {
  			return os.NewSyscallError("setsockopt", err)
  		}
  	}
  	return nil
  }
docs: // setSocketTimeout sets the receive and send timeouts on the given socket.