code: func (c *connection) getBestVersion(apiKey int16) int16 {
  	if requested, ok := c.apiVersions[apiKey]; ok {
  		supported := proto.SupportedByDriver[apiKey]
  		if min(supported.MaxVersion, requested.MaxVersion) >= max(supported.MinVersion, requested.MinVersion) {
  			return min(supported.MaxVersion, requested.MaxVersion)
  		}
  	}
  	return 0
  }
docs: //getBestVersion returns version for passed apiKey which best fit server and client requirements