How to decode the Application response from Golang SDK

Hi guys, I need help.

So I have an application where inside of it, my colleagues store the global state of an escrow address. I can easily fetch the global state using the goal command:

goal app read --app-id 206 --global --guess-format

The response:

{
 "Creator": {
  "tb": "LJCUHSVYTFQ2GTTZCPUJQS426F73YOPJIYOBEGVDRORSKW52US5XLKDAEY",
  "tt": 1
 },
 "Escrow": {
  "tb": "L2QLPRR3JGT65YL7DWAQKK4VCFG44QEAQG66XRONZ2YGT3ADULP4ORHUAE",
  "tt": 1
 },
...
}

But, I need to get the escrow address from the golang SDK, using this API:

algorand.Algod.GetApplicationByID(request.APP_ID).Do(c)

but the returned escrow address seems to be encoded.

"creator": "LJCUHSVYTFQ2GTTZCPUJQS426F73YOPJIYOBEGVDRORSKW52US5XLKDAEY",
        "extra-program-pages": 1,
        "global-state": [
             ...
             {
               "key": "RXNjcm93",
               "value": {
                          "bytes": "XqC3xjtJp+7hfx2BBSuVEU3OQICBvevFzc6waewDot8=",
                          "type": 1,
                          "uint": 0
                    }
            },
            ...
       ]

So how do I decode it so I can get the escrow address inside the “bytes”? Thank you

This is base64.
Decode the base64 into a 32-byte string.
This is the public key.

Then you need to convert it to an Algorand address by adding a checksum.
With the Go SDK, just cast the 32-byte string into an Address and use the String method: go-algorand-sdk/address.go at develop · algorand/go-algorand-sdk · GitHub

See also Overview - Algorand Developer Portal

Great! Thanks for the explanation.