code: func Sign(msg []byte, seckey []byte) ([]byte, error) {
  	if len(msg) != 32 {
  		return nil, ErrInvalidMsgLen
  	}
  	if len(seckey) != 32 {
  		return nil, ErrInvalidKey
  	}
  	seckeydata := (*C.uchar)(unsafe.Pointer(&seckey[0]))
  	if C.secp256k1_ec_seckey_verify(context, seckeydata) != 1 {
  		return nil, ErrInvalidKey
  	}
  
  	var (
  		msgdata   = (*C.uchar)(unsafe.Pointer(&msg[0]))
  		noncefunc = C.secp256k1_nonce_function_rfc6979
  		sigstruct C.secp256k1_ecdsa_recoverable_signature
  	)
  	if C.secp256k1_ecdsa_sign_recoverable(context, &sigstruct, msgdata, seckeydata, noncefunc, nil) == 0 {
  		return nil, ErrSignFailed
  	}
  
  	var (
  		sig     = make([]byte, 65)
  		sigdata = (*C.uchar)(unsafe.Pointer(&sig[0]))
  		recid   C.int
  	)
  	C.secp256k1_ecdsa_recoverable_signature_serialize_compact(context, sigdata, &recid, &sigstruct)
  	sig[64] = byte(recid) // add back recid to get 65 bytes sig
  	return sig, nil
  }
docs: // Sign creates a recoverable ECDSA signature.
  // The produced signature is in the 65-byte [R || S || V] format where V is 0 or 1.
  //
  // The caller is responsible for ensuring that msg cannot be chosen
  // directly by an attacker. It is usually preferable to use a cryptographic
  // hash function on any input before handing it to this function.