/usr/share/gocode/src/github.com/tendermint/go-common/net.go is in golang-github-tendermint-go-common-dev 0~20161202~0gitf40b1b6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | package common
import (
"net"
"strings"
)
// protoAddr: e.g. "tcp://127.0.0.1:8080" or "unix:///tmp/test.sock"
func Connect(protoAddr string) (net.Conn, error) {
parts := strings.SplitN(protoAddr, "://", 2)
proto, address := parts[0], parts[1]
conn, err := net.Dial(proto, address)
return conn, err
}
|