code: func tryLinger(conn net.Conn, sec int) {
  	type canLinger interface {
  		SetLinger(int) error
  	}
  
  	if lingerConn, ok := conn.(canLinger); ok {
  		_ = lingerConn.SetLinger(sec)
  	}
  }
docs: // try to set linger on the connection, if possible.