code: func PrivateKeyToDER(privateKey *ecdsa.PrivateKey) ([]byte, error) {
  	if privateKey == nil {
  		return nil, errors.New("Invalid ecdsa private key. It must be different from nil.")
  	}
  
  	return x509.MarshalECPrivateKey(privateKey)
  }
docs: // PrivateKeyToDER marshals a private key to der