How to use go to implement the following php code functions?

  golang, question
<?  php
 $private_key = "-----BEGIN RSA PRIVATE KEY-----
 MIICXAIBAAKBgQDFG/lh1FLEVF8J0AwZZvUQkISjS1m/nHRp3ZSgqH7C2O62ZBVn
 -----END RSA PRIVATE KEY-----";
 $ad_from = "111";
 $ids = "2202409872";
 $pi_key =  openssl_pkey_get_private($private_key);
 $str = "ad_from={$ad_from}&ids=[{$ids}]";
 //sign
 openssl_sign($str, $signature, $pi_key);
 $encrypted = base64_encode($signature);
 $encrypted = urlencode($encrypted);
 echo $encrypted;
 ?  >