code: func pickTLS12HashForSignature(sigType uint8, clientList []signatureAndHash) (uint8, error) {
  	if len(clientList) == 0 {
  		// If the client didn't specify any signature_algorithms
  		// extension then we can assume that it supports SHA1. See
  		// http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1
  		return hashSHA1, nil
  	}
  
  	for _, sigAndHash := range clientList {
  		if sigAndHash.signature != sigType {
  			continue
  		}
  		if isSupportedSignatureAndHash(sigAndHash, supportedSignatureAlgorithms) {
  			return sigAndHash.hash, nil
  		}
  	}
  
  	return 0, errors.New("tls: client doesn't support any common hash functions")
  }
docs: // pickTLS12HashForSignature returns a TLS 1.2 hash identifier for signing a
  // ServerKeyExchange given the signature type being used and the client's
  // advertised list of supported signature and hash combinations.