func (d *AutoDialer) Dial(ctx context.Context) (io.ReadWriteCloser, error) {
	conn, err := d.dialNet(ctx)
	return conn, err
}
Dial implements the jsonrpc2.Dialer interface.
package lsprpc
import (
	"context"
	"fmt"
	"io"
	"net"
	"os"
	"time"
	exec "golang.org/x/sys/execabs"
	"github.com/govim/govim/cmd/govim/internal/golang_org_x_tools/event"
	errors "golang.org/x/xerrors"
)
const AutoNetwork = "auto"
type AutoDialer struct {
	network, addr string  
	isAuto        bool    
	executable string
	argFunc    func(network, addr string) []string
}
func NewAutoDialer(rawAddr string, argFunc func(network, addr string) []string) (*AutoDialer, error) {
	d := AutoDialer{
		argFunc: argFunc,
	}
	d.network, d.addr = ParseAddr(rawAddr)
	if d.network == AutoNetwork {
		d.isAuto = true
		bin, err := os.Executable()
		if err != nil {
			return nil, errors.Errorf("getting executable: %w", err)
		}
		d.executable = bin
		d.network, d.addr = autoNetworkAddress(bin, d.addr)
	}
	return &d, nil
}