New to programming with golang and AWS. Block of code in my function, trying out creating a new table and writing values to it using AWS DynamoDB. Creation is successful, but the program crashes when the Write happens. Not sure why..I'd be really grateful if anyone could help me out!

**Logs**:

2015/07/22 15:46:46 TableStatus: 0xc208193cb0
2015/07/22 15:46:46 End
2015/07/22 15:46:48 Sleep 2: Before Write
2015/07/22 15:46:48 Before Defining Input
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x401b28]

**Code Block:**
 {
    log.Println("Entry+++")
        cfg := aws.DefaultConfig

        svc := dynamodb.New(cfg)

        tableDefinition := &dynamodb.CreateTableInput{
            TableName:            aws.String("table1"),
            AttributeDefinitions: make([]*dynamodb.AttributeDefinition, 1, 1),
            KeySchema:            make([]*dynamodb.KeySchemaElement, 1, 1),
            ProvisionedThroughput: &dynamodb.ProvisionedThroughput{
                ReadCapacityUnits:  aws.Long(1),
                WriteCapacityUnits: aws.Long(1),
            },
        }

        tableDefinition.KeySchema[0] = &dynamodb.KeySchemaElement{
            AttributeName: aws.String("batch_id"),
            KeyType:       aws.String("HASH"),
        }
        tableDefinition.AttributeDefinitions[0] = &dynamodb.AttributeDefinition{
            AttributeName: aws.String("batch_id"),
            AttributeType: aws.String("S"),
        }

        resp, err := svc.CreateTable(tableDefinition)
        log.Println("After CreateTable---")

        if err != nil {
            log.Println("create table failed", err.Error())
            return
        }
        if resp != nil && resp.TableDescription != nil {
            log.Println(
                "TableStatus:", resp.TableDescription.TableStatus)
        }

        log.Println("End")
        //Some time before the createTable transaction gets committed. 
        time.Sleep(2 * time.Second)
        log.Println("Sleep 2 Before Write")

        testA := "batch_1" //value to be written to the db
        // testB := "batch_name"
        // testC := "530"
        // testD := "Sample-Keyy-98"

        log.Println("Before Defining Input")
        input := &dynamodb.PutItemInput{
            TableName: aws.String("table1"),
            Item: map[string]*dynamodb.AttributeValue{
                "batch_id": &dynamodb.AttributeValue{
                    S: aws.String(testA),
                },
                // "name": &dynamodb.AttributeValue{
                //  S: aws.String(testB),
                // },
            },
        }

        _, err2 := svc.PutItem(input)
    }