Преглед изворни кода

complete changelog; format code

归邪 пре 8 година
родитељ
комит
f8d316e077

+ 1 - 0
ChangeLog.txt

@@ -1,6 +1,7 @@
 2018-01-17 Version: 0.8.1
 1. Set default timeout to 10s
 2. Make integration tests more stable
+3. Fix the problem of LocationResolver in concurrency
 
 2018-01-16 Version: 0.8.0
 1,  Add TriggerMode param in AddMediaWorkflow.

+ 2 - 2
integration/cdn_test.go

@@ -1,10 +1,10 @@
 package integration
 
 import (
-	"testing"
 	"fmt"
 	"github.com/aliyun/alibaba-cloud-sdk-go/services/cdn"
 	"github.com/stretchr/testify/assert"
+	"testing"
 )
 
 func TestCdnInstance(t *testing.T) {
@@ -20,7 +20,7 @@ func TestCdnInstance(t *testing.T) {
 
 }
 
-func assertCdnStatus(t *testing.T, client *cdn.Client){
+func assertCdnStatus(t *testing.T, client *cdn.Client) {
 	fmt.Print("describing cdn service status...")
 	request := cdn.CreateDescribeCdnServiceRequest()
 	response, err := client.DescribeCdnService(request)

+ 7 - 7
integration/ecs_test.go

@@ -2,22 +2,22 @@ package integration
 
 import (
 	"fmt"
+	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
 	"github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
 	"github.com/stretchr/testify/assert"
+	"strconv"
+	"strings"
 	"testing"
 	"time"
-	"strings"
-	"strconv"
-	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
 )
 
 const (
 	EcsInstanceDefaultTimeout = 120
 	EcsDefaultWaitForInterval = 20
 
-	EcsInstanceStatusRunning  = "Running"
-	EcsInstanceStatusStopped  = "Stopped"
-	EcsInstanceStatusDeleted  = "Deleted"
+	EcsInstanceStatusRunning = "Running"
+	EcsInstanceStatusStopped = "Stopped"
+	EcsInstanceStatusDeleted = "Deleted"
 )
 
 // create -> start -> stop -> delete
@@ -133,7 +133,7 @@ func deleteAllTestEcsInstance(t *testing.T, client *ecs.Client) {
 			if instanceInfo.Status == EcsInstanceStatusRunning {
 				// stop
 				stopEcsInstance(t, client, instanceInfo.InstanceId)
-			}else if instanceInfo.Status == EcsInstanceStatusStopped {
+			} else if instanceInfo.Status == EcsInstanceStatusStopped {
 				// delete
 				deleteEcsInstance(t, client, instanceInfo.InstanceId)
 				// wait

+ 4 - 4
integration/rds_test.go

@@ -1,13 +1,13 @@
 package integration
 
 import (
-	"testing"
 	"fmt"
 	"github.com/aliyun/alibaba-cloud-sdk-go/services/rds"
 	"github.com/stretchr/testify/assert"
-	"time"
 	"strconv"
 	"strings"
+	"testing"
+	"time"
 )
 
 const (
@@ -63,7 +63,7 @@ func createDBInstance(t *testing.T, client *rds.Client) (rdsInstanceId string) {
 	return
 }
 
-func getHAConfig(t *testing.T, client *rds.Client, instanceId string)(nodeId string){
+func getHAConfig(t *testing.T, client *rds.Client, instanceId string) (nodeId string) {
 	fmt.Print("get dbInstance HA nodeId...")
 	request := rds.CreateDescribeDBInstanceHAConfigRequest()
 	request.DBInstanceId = instanceId
@@ -75,7 +75,7 @@ func getHAConfig(t *testing.T, client *rds.Client, instanceId string)(nodeId str
 	return
 }
 
-func changeNodeToMaster(t *testing.T, client *rds.Client, instanceId, nodeId string){
+func changeNodeToMaster(t *testing.T, client *rds.Client, instanceId, nodeId string) {
 	fmt.Print("trying to change current instance to master...")
 	request := rds.CreateSwitchDBInstanceHARequest()
 	request.DBInstanceId = instanceId

+ 5 - 5
integration/slb_test.go

@@ -2,14 +2,14 @@ package integration
 
 import (
 	"fmt"
-	"github.com/stretchr/testify/assert"
-	"testing"
-	"time"
-	"github.com/aliyun/alibaba-cloud-sdk-go/services/slb"
-	"strconv"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/utils"
+	"github.com/aliyun/alibaba-cloud-sdk-go/services/slb"
+	"github.com/stretchr/testify/assert"
 	"net/http"
+	"strconv"
 	"strings"
+	"testing"
+	"time"
 )
 
 const (

+ 2 - 3
integration/utils.go

@@ -1,12 +1,12 @@
 package integration
 
 import (
+	"fmt"
 	"os"
 	"testing"
-	"fmt"
 )
 
-const InstanceNamePrefix  = "SdkIntegrationTestInstance"
+const InstanceNamePrefix = "SdkIntegrationTestInstance"
 
 type Config struct {
 	AccessKeyId     string
@@ -35,7 +35,6 @@ func getConfigFromEnv() *Config {
 	}
 }
 
-
 func getEcsDemoInstanceId() string {
 	return os.Getenv("DEMO_ECS_INSTANCE_ID")
 }

+ 4 - 4
integration/vpc_test.go

@@ -1,12 +1,12 @@
 package integration
 
 import (
-	"testing"
 	"fmt"
 	"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
+	"github.com/stretchr/testify/assert"
 	"strconv"
+	"testing"
 	"time"
-	"github.com/stretchr/testify/assert"
 )
 
 func TestVpcInstance(t *testing.T) {
@@ -62,7 +62,7 @@ func createVswitchInstance(t *testing.T, client *vpc.Client, vpcId string) (vswi
 	return
 }
 
-func deleteVSwitchInstance(t *testing.T, client *vpc.Client, vswitchId string)() {
+func deleteVSwitchInstance(t *testing.T, client *vpc.Client, vswitchId string) {
 	fmt.Printf("deleting vswitch instance(%s)...", vswitchId)
 	request := vpc.CreateDeleteVSwitchRequest()
 	request.VSwitchId = vswitchId
@@ -73,7 +73,7 @@ func deleteVSwitchInstance(t *testing.T, client *vpc.Client, vswitchId string)()
 	return
 }
 
-func deleteVpcInstance(t *testing.T, client *vpc.Client, vpcId string){
+func deleteVpcInstance(t *testing.T, client *vpc.Client, vpcId string) {
 	fmt.Printf("deleting vpc instance(%s)...", vpcId)
 	request := vpc.CreateDeleteVpcRequest()
 	request.VpcId = vpcId

+ 5 - 1
sdk/client_test.go

@@ -15,6 +15,7 @@
 package sdk
 
 import (
+	"crypto/tls"
 	"encoding/json"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/auth/credentials"
 	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
@@ -99,7 +100,10 @@ func testSetup() {
 	clientConfig := NewConfig().
 		WithEnableAsync(true).
 		WithGoRoutinePoolSize(5).
-		WithMaxTaskQueueSize(1000)
+		WithMaxTaskQueueSize(1000).
+		WithHttpTransport(&http.Transport{
+			TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
+		})
 
 	credential := &credentials.BaseCredential{
 		AccessKeyId:     testConfig.AccessKeyId,

+ 1 - 1
sdk/errors/client_error.go

@@ -38,7 +38,7 @@ const (
 	MissingParamCode = "SDK.MissingParam"
 	InvalidParamCode = "SDK.InvalidParam"
 
-	JsonUnmarshalCode = "SDK.JsonUnmarshalError"
+	JsonUnmarshalCode    = "SDK.JsonUnmarshalError"
 	JsonUnmarshalMessage = "Failed to unmarshal response, but you can get the data via response.GetHttpStatusCode() and response.GetHttpContentString()"
 )
 

+ 60 - 60
vendor/github.com/jmespath/go-jmespath/functions.go

@@ -124,197 +124,197 @@ type functionCaller struct {
 func newFunctionCaller() *functionCaller {
 	caller := &functionCaller{}
 	caller.functionTable = map[string]functionEntry{
-		"length": functionEntry{
+		"length": {
 			name: "length",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpString, jpArray, jpObject}},
+				{types: []jpType{jpString, jpArray, jpObject}},
 			},
 			handler: jpfLength,
 		},
-		"starts_with": functionEntry{
+		"starts_with": {
 			name: "starts_with",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpString}},
-				argSpec{types: []jpType{jpString}},
+				{types: []jpType{jpString}},
+				{types: []jpType{jpString}},
 			},
 			handler: jpfStartsWith,
 		},
-		"abs": functionEntry{
+		"abs": {
 			name: "abs",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpNumber}},
+				{types: []jpType{jpNumber}},
 			},
 			handler: jpfAbs,
 		},
-		"avg": functionEntry{
+		"avg": {
 			name: "avg",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArrayNumber}},
+				{types: []jpType{jpArrayNumber}},
 			},
 			handler: jpfAvg,
 		},
-		"ceil": functionEntry{
+		"ceil": {
 			name: "ceil",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpNumber}},
+				{types: []jpType{jpNumber}},
 			},
 			handler: jpfCeil,
 		},
-		"contains": functionEntry{
+		"contains": {
 			name: "contains",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArray, jpString}},
-				argSpec{types: []jpType{jpAny}},
+				{types: []jpType{jpArray, jpString}},
+				{types: []jpType{jpAny}},
 			},
 			handler: jpfContains,
 		},
-		"ends_with": functionEntry{
+		"ends_with": {
 			name: "ends_with",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpString}},
-				argSpec{types: []jpType{jpString}},
+				{types: []jpType{jpString}},
+				{types: []jpType{jpString}},
 			},
 			handler: jpfEndsWith,
 		},
-		"floor": functionEntry{
+		"floor": {
 			name: "floor",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpNumber}},
+				{types: []jpType{jpNumber}},
 			},
 			handler: jpfFloor,
 		},
-		"map": functionEntry{
+		"map": {
 			name: "amp",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpExpref}},
-				argSpec{types: []jpType{jpArray}},
+				{types: []jpType{jpExpref}},
+				{types: []jpType{jpArray}},
 			},
 			handler:   jpfMap,
 			hasExpRef: true,
 		},
-		"max": functionEntry{
+		"max": {
 			name: "max",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArrayNumber, jpArrayString}},
+				{types: []jpType{jpArrayNumber, jpArrayString}},
 			},
 			handler: jpfMax,
 		},
-		"merge": functionEntry{
+		"merge": {
 			name: "merge",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpObject}, variadic: true},
+				{types: []jpType{jpObject}, variadic: true},
 			},
 			handler: jpfMerge,
 		},
-		"max_by": functionEntry{
+		"max_by": {
 			name: "max_by",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArray}},
-				argSpec{types: []jpType{jpExpref}},
+				{types: []jpType{jpArray}},
+				{types: []jpType{jpExpref}},
 			},
 			handler:   jpfMaxBy,
 			hasExpRef: true,
 		},
-		"sum": functionEntry{
+		"sum": {
 			name: "sum",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArrayNumber}},
+				{types: []jpType{jpArrayNumber}},
 			},
 			handler: jpfSum,
 		},
-		"min": functionEntry{
+		"min": {
 			name: "min",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArrayNumber, jpArrayString}},
+				{types: []jpType{jpArrayNumber, jpArrayString}},
 			},
 			handler: jpfMin,
 		},
-		"min_by": functionEntry{
+		"min_by": {
 			name: "min_by",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArray}},
-				argSpec{types: []jpType{jpExpref}},
+				{types: []jpType{jpArray}},
+				{types: []jpType{jpExpref}},
 			},
 			handler:   jpfMinBy,
 			hasExpRef: true,
 		},
-		"type": functionEntry{
+		"type": {
 			name: "type",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpAny}},
+				{types: []jpType{jpAny}},
 			},
 			handler: jpfType,
 		},
-		"keys": functionEntry{
+		"keys": {
 			name: "keys",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpObject}},
+				{types: []jpType{jpObject}},
 			},
 			handler: jpfKeys,
 		},
-		"values": functionEntry{
+		"values": {
 			name: "values",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpObject}},
+				{types: []jpType{jpObject}},
 			},
 			handler: jpfValues,
 		},
-		"sort": functionEntry{
+		"sort": {
 			name: "sort",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArrayString, jpArrayNumber}},
+				{types: []jpType{jpArrayString, jpArrayNumber}},
 			},
 			handler: jpfSort,
 		},
-		"sort_by": functionEntry{
+		"sort_by": {
 			name: "sort_by",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArray}},
-				argSpec{types: []jpType{jpExpref}},
+				{types: []jpType{jpArray}},
+				{types: []jpType{jpExpref}},
 			},
 			handler:   jpfSortBy,
 			hasExpRef: true,
 		},
-		"join": functionEntry{
+		"join": {
 			name: "join",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpString}},
-				argSpec{types: []jpType{jpArrayString}},
+				{types: []jpType{jpString}},
+				{types: []jpType{jpArrayString}},
 			},
 			handler: jpfJoin,
 		},
-		"reverse": functionEntry{
+		"reverse": {
 			name: "reverse",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpArray, jpString}},
+				{types: []jpType{jpArray, jpString}},
 			},
 			handler: jpfReverse,
 		},
-		"to_array": functionEntry{
+		"to_array": {
 			name: "to_array",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpAny}},
+				{types: []jpType{jpAny}},
 			},
 			handler: jpfToArray,
 		},
-		"to_string": functionEntry{
+		"to_string": {
 			name: "to_string",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpAny}},
+				{types: []jpType{jpAny}},
 			},
 			handler: jpfToString,
 		},
-		"to_number": functionEntry{
+		"to_number": {
 			name: "to_number",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpAny}},
+				{types: []jpType{jpAny}},
 			},
 			handler: jpfToNumber,
 		},
-		"not_null": functionEntry{
+		"not_null": {
 			name: "not_null",
 			arguments: []argSpec{
-				argSpec{types: []jpType{jpAny}, variadic: true},
+				{types: []jpType{jpAny}, variadic: true},
 			},
 			handler: jpfNotNull,
 		},

+ 6 - 6
vendor/github.com/jmespath/go-jmespath/interpreter_test.go

@@ -69,7 +69,7 @@ func TestCanSupportUserDefinedStructsRef(t *testing.T) {
 
 func TestCanSupportStructWithSliceAll(t *testing.T) {
 	assert := assert.New(t)
-	data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+	data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
 	result, err := Search("B[].Foo", data)
 	assert.Nil(err)
 	assert.Equal([]interface{}{"f1", "correct"}, result)
@@ -77,7 +77,7 @@ func TestCanSupportStructWithSliceAll(t *testing.T) {
 
 func TestCanSupportStructWithSlicingExpression(t *testing.T) {
 	assert := assert.New(t)
-	data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+	data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
 	result, err := Search("B[:].Foo", data)
 	assert.Nil(err)
 	assert.Equal([]interface{}{"f1", "correct"}, result)
@@ -85,7 +85,7 @@ func TestCanSupportStructWithSlicingExpression(t *testing.T) {
 
 func TestCanSupportStructWithFilterProjection(t *testing.T) {
 	assert := assert.New(t)
-	data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+	data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
 	result, err := Search("B[? `true` ].Foo", data)
 	assert.Nil(err)
 	assert.Equal([]interface{}{"f1", "correct"}, result)
@@ -93,7 +93,7 @@ func TestCanSupportStructWithFilterProjection(t *testing.T) {
 
 func TestCanSupportStructWithSlice(t *testing.T) {
 	assert := assert.New(t)
-	data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+	data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
 	result, err := Search("B[-1].Foo", data)
 	assert.Nil(err)
 	assert.Equal("correct", result)
@@ -109,7 +109,7 @@ func TestCanSupportStructWithOrExpressions(t *testing.T) {
 
 func TestCanSupportStructWithSlicePointer(t *testing.T) {
 	assert := assert.New(t)
-	data := sliceType{A: "foo", C: []*scalars{&scalars{"f1", "b1"}, &scalars{"correct", "b2"}}}
+	data := sliceType{A: "foo", C: []*scalars{{"f1", "b1"}, {"correct", "b2"}}}
 	result, err := Search("C[-1].Foo", data)
 	assert.Nil(err)
 	assert.Equal("correct", result)
@@ -128,7 +128,7 @@ func TestWillAutomaticallyCapitalizeFieldNames(t *testing.T) {
 
 func TestCanSupportStructWithSliceLowerCased(t *testing.T) {
 	assert := assert.New(t)
-	data := sliceType{A: "foo", B: []scalars{scalars{"f1", "b1"}, scalars{"correct", "b2"}}}
+	data := sliceType{A: "foo", B: []scalars{{"f1", "b1"}, {"correct", "b2"}}}
 	result, err := Search("b[-1].foo", data)
 	assert.Nil(err)
 	assert.Equal("correct", result)

+ 49 - 49
vendor/github.com/jmespath/go-jmespath/lexer_test.go

@@ -11,63 +11,63 @@ var lexingTests = []struct {
 	expression string
 	expected   []token
 }{
-	{"*", []token{token{tStar, "*", 0, 1}}},
-	{".", []token{token{tDot, ".", 0, 1}}},
-	{"[?", []token{token{tFilter, "[?", 0, 2}}},
-	{"[]", []token{token{tFlatten, "[]", 0, 2}}},
-	{"(", []token{token{tLparen, "(", 0, 1}}},
-	{")", []token{token{tRparen, ")", 0, 1}}},
-	{"[", []token{token{tLbracket, "[", 0, 1}}},
-	{"]", []token{token{tRbracket, "]", 0, 1}}},
-	{"{", []token{token{tLbrace, "{", 0, 1}}},
-	{"}", []token{token{tRbrace, "}", 0, 1}}},
-	{"||", []token{token{tOr, "||", 0, 2}}},
-	{"|", []token{token{tPipe, "|", 0, 1}}},
-	{"29", []token{token{tNumber, "29", 0, 2}}},
-	{"2", []token{token{tNumber, "2", 0, 1}}},
-	{"0", []token{token{tNumber, "0", 0, 1}}},
-	{"-20", []token{token{tNumber, "-20", 0, 3}}},
-	{"foo", []token{token{tUnquotedIdentifier, "foo", 0, 3}}},
-	{`"bar"`, []token{token{tQuotedIdentifier, "bar", 0, 3}}},
+	{"*", []token{{tStar, "*", 0, 1}}},
+	{".", []token{{tDot, ".", 0, 1}}},
+	{"[?", []token{{tFilter, "[?", 0, 2}}},
+	{"[]", []token{{tFlatten, "[]", 0, 2}}},
+	{"(", []token{{tLparen, "(", 0, 1}}},
+	{")", []token{{tRparen, ")", 0, 1}}},
+	{"[", []token{{tLbracket, "[", 0, 1}}},
+	{"]", []token{{tRbracket, "]", 0, 1}}},
+	{"{", []token{{tLbrace, "{", 0, 1}}},
+	{"}", []token{{tRbrace, "}", 0, 1}}},
+	{"||", []token{{tOr, "||", 0, 2}}},
+	{"|", []token{{tPipe, "|", 0, 1}}},
+	{"29", []token{{tNumber, "29", 0, 2}}},
+	{"2", []token{{tNumber, "2", 0, 1}}},
+	{"0", []token{{tNumber, "0", 0, 1}}},
+	{"-20", []token{{tNumber, "-20", 0, 3}}},
+	{"foo", []token{{tUnquotedIdentifier, "foo", 0, 3}}},
+	{`"bar"`, []token{{tQuotedIdentifier, "bar", 0, 3}}},
 	// Escaping the delimiter
-	{`"bar\"baz"`, []token{token{tQuotedIdentifier, `bar"baz`, 0, 7}}},
-	{",", []token{token{tComma, ",", 0, 1}}},
-	{":", []token{token{tColon, ":", 0, 1}}},
-	{"<", []token{token{tLT, "<", 0, 1}}},
-	{"<=", []token{token{tLTE, "<=", 0, 2}}},
-	{">", []token{token{tGT, ">", 0, 1}}},
-	{">=", []token{token{tGTE, ">=", 0, 2}}},
-	{"==", []token{token{tEQ, "==", 0, 2}}},
-	{"!=", []token{token{tNE, "!=", 0, 2}}},
-	{"`[0, 1, 2]`", []token{token{tJSONLiteral, "[0, 1, 2]", 1, 9}}},
-	{"'foo'", []token{token{tStringLiteral, "foo", 1, 3}}},
-	{"'a'", []token{token{tStringLiteral, "a", 1, 1}}},
-	{`'foo\'bar'`, []token{token{tStringLiteral, "foo'bar", 1, 7}}},
-	{"@", []token{token{tCurrent, "@", 0, 1}}},
-	{"&", []token{token{tExpref, "&", 0, 1}}},
+	{`"bar\"baz"`, []token{{tQuotedIdentifier, `bar"baz`, 0, 7}}},
+	{",", []token{{tComma, ",", 0, 1}}},
+	{":", []token{{tColon, ":", 0, 1}}},
+	{"<", []token{{tLT, "<", 0, 1}}},
+	{"<=", []token{{tLTE, "<=", 0, 2}}},
+	{">", []token{{tGT, ">", 0, 1}}},
+	{">=", []token{{tGTE, ">=", 0, 2}}},
+	{"==", []token{{tEQ, "==", 0, 2}}},
+	{"!=", []token{{tNE, "!=", 0, 2}}},
+	{"`[0, 1, 2]`", []token{{tJSONLiteral, "[0, 1, 2]", 1, 9}}},
+	{"'foo'", []token{{tStringLiteral, "foo", 1, 3}}},
+	{"'a'", []token{{tStringLiteral, "a", 1, 1}}},
+	{`'foo\'bar'`, []token{{tStringLiteral, "foo'bar", 1, 7}}},
+	{"@", []token{{tCurrent, "@", 0, 1}}},
+	{"&", []token{{tExpref, "&", 0, 1}}},
 	// Quoted identifier unicode escape sequences
-	{`"\u2713"`, []token{token{tQuotedIdentifier, "✓", 0, 3}}},
-	{`"\\"`, []token{token{tQuotedIdentifier, `\`, 0, 1}}},
-	{"`\"foo\"`", []token{token{tJSONLiteral, "\"foo\"", 1, 5}}},
+	{`"\u2713"`, []token{{tQuotedIdentifier, "✓", 0, 3}}},
+	{`"\\"`, []token{{tQuotedIdentifier, `\`, 0, 1}}},
+	{"`\"foo\"`", []token{{tJSONLiteral, "\"foo\"", 1, 5}}},
 	// Combinations of tokens.
 	{"foo.bar", []token{
-		token{tUnquotedIdentifier, "foo", 0, 3},
-		token{tDot, ".", 3, 1},
-		token{tUnquotedIdentifier, "bar", 4, 3},
+		{tUnquotedIdentifier, "foo", 0, 3},
+		{tDot, ".", 3, 1},
+		{tUnquotedIdentifier, "bar", 4, 3},
 	}},
 	{"foo[0]", []token{
-		token{tUnquotedIdentifier, "foo", 0, 3},
-		token{tLbracket, "[", 3, 1},
-		token{tNumber, "0", 4, 1},
-		token{tRbracket, "]", 5, 1},
+		{tUnquotedIdentifier, "foo", 0, 3},
+		{tLbracket, "[", 3, 1},
+		{tNumber, "0", 4, 1},
+		{tRbracket, "]", 5, 1},
 	}},
 	{"foo[?a<b]", []token{
-		token{tUnquotedIdentifier, "foo", 0, 3},
-		token{tFilter, "[?", 3, 2},
-		token{tUnquotedIdentifier, "a", 5, 1},
-		token{tLT, "<", 6, 1},
-		token{tUnquotedIdentifier, "b", 7, 1},
-		token{tRbracket, "]", 8, 1},
+		{tUnquotedIdentifier, "foo", 0, 3},
+		{tFilter, "[?", 3, 2},
+		{tUnquotedIdentifier, "a", 5, 1},
+		{tLT, "<", 6, 1},
+		{tUnquotedIdentifier, "b", 7, 1},
+		{tRbracket, "]", 8, 1},
 	}},
 }
 

+ 2 - 2
vendor/github.com/jmespath/go-jmespath/parser.go

@@ -353,7 +353,7 @@ func (p *Parser) nud(token token) (ASTNode, error) {
 	case tFlatten:
 		left := ASTNode{
 			nodeType: ASTFlatten,
-			children: []ASTNode{ASTNode{nodeType: ASTIdentity}},
+			children: []ASTNode{{nodeType: ASTIdentity}},
 		}
 		right, err := p.parseProjectionRHS(bindingPowers[tFlatten])
 		if err != nil {
@@ -378,7 +378,7 @@ func (p *Parser) nud(token token) (ASTNode, error) {
 			}
 			return ASTNode{
 				nodeType: ASTProjection,
-				children: []ASTNode{ASTNode{nodeType: ASTIdentity}, right},
+				children: []ASTNode{{nodeType: ASTIdentity}, right},
 			}, nil
 		} else {
 			return p.parseMultiSelectList()

+ 1 - 1
vendor/github.com/jmespath/go-jmespath/util_test.go

@@ -13,7 +13,7 @@ func TestSlicePositiveStep(t *testing.T) {
 	input[2] = 2
 	input[3] = 3
 	input[4] = 4
-	result, err := slice(input, []sliceParam{sliceParam{0, true}, sliceParam{3, true}, sliceParam{1, true}})
+	result, err := slice(input, []sliceParam{{0, true}, {3, true}, {1, true}})
 	assert.Nil(err)
 	assert.Equal(input[:3], result)
 }

+ 3 - 3
vendor/github.com/stretchr/testify/mock/mock_test.go

@@ -126,13 +126,13 @@ func Test_Mock_Chained_On(t *testing.T) {
 		Return(nil)
 
 	expectedCalls := []*Call{
-		&Call{
+		{
 			Parent:          &mockedService.Mock,
 			Method:          "TheExampleMethod",
 			Arguments:       []interface{}{1, 2, 3},
 			ReturnArguments: []interface{}{0},
 		},
-		&Call{
+		{
 			Parent:          &mockedService.Mock,
 			Method:          "TheExampleMethod3",
 			Arguments:       []interface{}{AnythingOfType("*mock.ExampleType")},
@@ -1342,7 +1342,7 @@ func TestAfterTotalWaitTimeWhileExecution(t *testing.T) {
 	elapsedTime := end.Sub(start)
 	assert.True(t, elapsedTime > waitMs, fmt.Sprintf("Total elapsed time:%v should be atleast greater than %v", elapsedTime, waitMs))
 	assert.Equal(t, total, len(results))
-	for i, _ := range results {
+	for i := range results {
 		assert.Equal(t, fmt.Sprintf("Time%d", i), results[i], "Return value of method should be same")
 	}
 }

+ 2 - 2
vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format_test.go

@@ -1536,14 +1536,14 @@ func TestPrintSortedKeys(t *testing.T) {
 		t.Errorf("Sorted keys mismatch 3:\n  %v %v", s, expected)
 	}
 
-	s = cfg.Sprint(map[testStruct]int{testStruct{1}: 1, testStruct{3}: 3, testStruct{2}: 2})
+	s = cfg.Sprint(map[testStruct]int{{1}: 1, {3}: 3, {2}: 2})
 	expected = "map[ts.1:1 ts.2:2 ts.3:3]"
 	if s != expected {
 		t.Errorf("Sorted keys mismatch 4:\n  %v %v", s, expected)
 	}
 
 	if !spew.UnsafeDisabled {
-		s = cfg.Sprint(map[testStructP]int{testStructP{1}: 1, testStructP{3}: 3, testStructP{2}: 2})
+		s = cfg.Sprint(map[testStructP]int{{1}: 1, {3}: 3, {2}: 2})
 		expected = "map[ts.1:1 ts.2:2 ts.3:3]"
 		if s != expected {
 			t.Errorf("Sorted keys mismatch 5:\n  %v %v", s, expected)

+ 4 - 4
vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go

@@ -161,12 +161,12 @@ func (m *SequenceMatcher) chainB() {
 	m.bJunk = map[string]struct{}{}
 	if m.IsJunk != nil {
 		junk := m.bJunk
-		for s, _ := range b2j {
+		for s := range b2j {
 			if m.IsJunk(s) {
 				junk[s] = struct{}{}
 			}
 		}
-		for s, _ := range junk {
+		for s := range junk {
 			delete(b2j, s)
 		}
 	}
@@ -181,7 +181,7 @@ func (m *SequenceMatcher) chainB() {
 				popular[s] = struct{}{}
 			}
 		}
-		for s, _ := range popular {
+		for s := range popular {
 			delete(b2j, s)
 		}
 	}
@@ -416,7 +416,7 @@ func (m *SequenceMatcher) GetGroupedOpCodes(n int) [][]OpCode {
 	}
 	codes := m.GetOpCodes()
 	if len(codes) == 0 {
-		codes = []OpCode{OpCode{'e', 0, 1, 0, 1}}
+		codes = []OpCode{{'e', 0, 1, 0, 1}}
 	}
 	// Fixup leading and trailing groups if they show no changes.
 	if codes[0].Tag == 'e' {

+ 2 - 2
vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib_test.go

@@ -206,14 +206,14 @@ func TestWithAsciiBJunk(t *testing.T) {
 
 	sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
 		splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk)
-	assertEqual(t, sm.bJunk, map[string]struct{}{" ": struct{}{}})
+	assertEqual(t, sm.bJunk, map[string]struct{}{" ": {}})
 
 	isJunk = func(s string) bool {
 		return s == " " || s == "b"
 	}
 	sm = NewMatcherWithJunk(splitChars(rep("a", 40)+rep("b", 40)),
 		splitChars(rep("a", 44)+rep("b", 40)+rep(" ", 20)), false, isJunk)
-	assertEqual(t, sm.bJunk, map[string]struct{}{" ": struct{}{}, "b": struct{}{}})
+	assertEqual(t, sm.bJunk, map[string]struct{}{" ": {}, "b": {}})
 }
 
 func TestSFBugsRatioForNullSeqn(t *testing.T) {