amqp icon indicating copy to clipboard operation
amqp copied to clipboard

Why use struct instead of pointer?

Open super9du opened this issue 3 years ago • 1 comments

https://github.com/streadway/amqp/blob/e6b33f460591b0acb2f13b04ef9cf493720ffe17/connection.go#L223

func Open(conn io.ReadWriteCloser, config Config) (*Connection, error) {
	c := &Connection{
		conn:      conn,
		writer:    &writer{bufio.NewWriter(conn)},
		channels:  make(map[uint16]*Channel),
		rpc:       make(chan message),
		sends:     make(chan time.Time),
		errors:    make(chan *Error, 1),
		deadlines: make(chan readDeadliner, 1),
	}
	go c.reader(conn)
	return c, c.open(config)
}

super9du avatar Oct 26 '21 08:10 super9du

the arg "config" is not a pointer.

super9du avatar Nov 01 '21 07:11 super9du