title: Golang dynamodb parallel scan returning same LastEvaluatedKey for all segment
body: <p>I am running a <code>golang</code> program that do <code>parallel scan</code> of <code>dynamodb</code> table. My ScanInput object is:</p>
  <pre><code>params = &amp;dynamodb.ScanInput{
                  TableName:         aws.String(tableName),
                  ExclusiveStartKey: lastEvalKey,
                  Segment:       aws.Int64(segment),
                  TotalSegments: aws.Int64(TOTAL_SEG),
              }
  </code></pre>
  <p>I am getting error for all <code>segment</code> except first. For example if <code>totalsegment</code> is 4 than 3 will return below error:</p>
  <pre><code>ValidationException: The provided starting key is invalid: Invalid ExclusiveStartKey. Please use ExclusiveStartKey with correct Segment. TotalSegments: 4 Segment: 2
  </code></pre>
  <p>I checked by debugging that for segment that is having error <code>LastEvaluatedKey</code> is same as segment that is not throwing error.</p>
  <p>I am calling the function that do scan as goroutine in waitgroup for each segment.</p>
  <pre><code>var wg sync.WaitGroup
      wg.Add(int(TOTAL_SEG))
  
      for i := 0; i &lt; int(TOTAL_SEG); i++ {
          go func(i int) {
              Scan(int64(i))
              wg.Done()
          }(i)
      }
  
      wg.Wait()
  </code></pre>
  <p>Can anyone guide what is issue. Thanks in advance.</p>