title: How to parse dynamodb result to an integer?
body: <p>I'm unable to unmarshall a fairly simple data structure:</p>
  
  <pre><code>"video_lite": { "id": 1573, "name": "Blade Runner (Movie)" }
  </code></pre>
  
  <p>Here's my code that doesn't work:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  
      "github.com/aws/aws-sdk-go/aws"
      "github.com/aws/aws-sdk-go/aws/session"
      "github.com/aws/aws-sdk-go/service/dynamodb"
      "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
  )
  
  type Video struct {
      video_lite struct {
          name string
          id   int
      }
  }
  
  func check(err error) {
      if err != nil {
          panic(err.Error())
      }
  }
  
  func main() {
  
      svc := dynamodb.New(session.New())
  
      input := &amp;dynamodb.GetItemInput{
          Key:                  map[string]*dynamodb.AttributeValue{"uuid": {S: aws.String("d610e853-5222-462c-9bb3-26ff5aa86e9d")}},
          ProjectionExpression: aws.String("video_lite"),
          TableName:            aws.String("staging_video_ingestion"),
      }
  
      result, err := svc.GetItem(input)
      check(err)
  
      fmt.Printf("%+v\n", result.Item)
      var t Video
  
      err = dynamodbattribute.UnmarshalMap(result.Item, &amp;t)
      check(err)
  
      fmt.Printf("%+v\n", t)
  
  }
  </code></pre>
  
  <p>The output looks like:</p>
  
  <pre><code>map[video_lite:{
    M: {
      id: {
        N: "1573"
      },
      name: {
        S: "Bladerunner (Movie)"
      }
    }
  }]
  {video_lite:{name: id:0}}
  </code></pre>
  
  <p>Why doesn't the <a href="https://godoc.org/github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute#UnmarshalMap" rel="nofollow noreferrer">UnmarshalMap</a> work?</p>