Ver código fonte

Merge branch 'test' of github.com:aliyun/alibaba-cloud-sdk-go into test

高汝彤 7 anos atrás
pai
commit
fb0e64a124
30 arquivos alterados com 210 adições e 206 exclusões
  1. 2 0
      ChangeLog.txt
  2. 2 2
      integration/cdn_test.go
  3. 7 7
      integration/ecs_test.go
  4. 4 4
      integration/rds_test.go
  5. 5 5
      integration/slb_test.go
  6. 2 3
      integration/utils.go
  7. 4 4
      integration/vpc_test.go
  8. 0 5
      sdk/auth/credentials/EcsInstanceCredential.go
  9. 1 1
      sdk/auth/credentials/RsaKeyPairCredential.go
  10. 1 1
      sdk/auth/credentials/StsRoleArnCredential.go
  11. 5 0
      sdk/auth/credentials/StsRoleNameOnEcsCredential.go
  12. 3 3
      sdk/auth/signer.go
  13. 2 2
      sdk/auth/signers/signer_ecs_instance.go
  14. 2 2
      sdk/auth/signers/signer_key_pair.go
  15. 2 2
      sdk/auth/signers/signer_sts_assume_role.go
  16. 2 2
      sdk/auth/signers/signer_v2.go
  17. 18 18
      sdk/client.go
  18. 10 6
      sdk/client_test.go
  19. 2 3
      sdk/endpoints/location_resolver.go
  20. 6 6
      sdk/endpoints/resolver.go
  21. 1 1
      sdk/errors/client_error.go
  22. 60 60
      vendor/github.com/jmespath/go-jmespath/functions.go
  23. 6 6
      vendor/github.com/jmespath/go-jmespath/interpreter_test.go
  24. 49 49
      vendor/github.com/jmespath/go-jmespath/lexer_test.go
  25. 2 2
      vendor/github.com/jmespath/go-jmespath/parser.go
  26. 1 1
      vendor/github.com/jmespath/go-jmespath/util_test.go
  27. 3 3
      vendor/github.com/stretchr/testify/mock/mock_test.go
  28. 2 2
      vendor/github.com/stretchr/testify/vendor/github.com/davecgh/go-spew/spew/format_test.go
  29. 4 4
      vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib.go
  30. 2 2
      vendor/github.com/stretchr/testify/vendor/github.com/pmezard/go-difflib/difflib/difflib_test.go

+ 2 - 0
ChangeLog.txt

@@ -1,6 +1,8 @@
 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
+4. Modifying the naming specification
 
 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

+ 0 - 5
sdk/auth/credentials/EcsInstanceCredential.go

@@ -1,5 +0,0 @@
-package credentials
-
-type EcsInstanceCredential struct {
-	RoleName string
-}

+ 1 - 1
sdk/auth/credentials/KeyPairCredential.go → sdk/auth/credentials/RsaKeyPairCredential.go

@@ -1,6 +1,6 @@
 package credentials
 
-type KeyPairCredential struct {
+type RsaKeyPairCredential struct {
 	PrivateKey        string
 	PublicKeyId       string
 	SessionExpiration int

+ 1 - 1
sdk/auth/credentials/StsAssumeRoleCredential.go → sdk/auth/credentials/StsRoleArnCredential.go

@@ -1,6 +1,6 @@
 package credentials
 
-type StsAssumeRoleCredential struct {
+type StsRoleArnCredential struct {
 	AccessKeyId           string
 	AccessKeySecret       string
 	RoleArn               string

+ 5 - 0
sdk/auth/credentials/StsRoleNameOnEcsCredential.go

@@ -0,0 +1,5 @@
+package credentials
+
+type StsRoleNameOnEcsCredential struct {
+	RoleName string
+}

+ 3 - 3
sdk/auth/signer.go

@@ -44,15 +44,15 @@ func NewSignerWithCredential(credential Credential, commonApi func(request *requ
 		{
 			signer, err = signers.NewSignerSts(instance)
 		}
-	case *credentials.StsAssumeRoleCredential:
+	case *credentials.StsRoleArnCredential:
 		{
 			signer, err = signers.NewSignerStsAssumeRole(instance, commonApi)
 		}
-	case *credentials.KeyPairCredential:
+	case *credentials.RsaKeyPairCredential:
 		{
 			signer, err = signers.NewSignerKeyPair(instance, commonApi)
 		}
-	case *credentials.EcsInstanceCredential:
+	case *credentials.StsRoleNameOnEcsCredential:
 		{
 			signer, err = signers.NewSignereEcsInstance(instance, commonApi)
 		}

+ 2 - 2
sdk/auth/signers/signer_ecs_instance.go

@@ -29,11 +29,11 @@ import (
 type SignerEcsInstance struct {
 	*credentialUpdater
 	sessionCredential *sessionCredential
-	credential        *credentials.EcsInstanceCredential
+	credential        *credentials.StsRoleNameOnEcsCredential
 	commonApi         func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
 }
 
-func NewSignereEcsInstance(credential *credentials.EcsInstanceCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerEcsInstance, err error) {
+func NewSignereEcsInstance(credential *credentials.StsRoleNameOnEcsCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerEcsInstance, err error) {
 	signer = &SignerEcsInstance{
 		credential: credential,
 		commonApi:  commonApi,

+ 2 - 2
sdk/auth/signers/signer_key_pair.go

@@ -29,7 +29,7 @@ import (
 type SignerKeyPair struct {
 	*credentialUpdater
 	sessionCredential *SessionAkCredential
-	credential        *credentials.KeyPairCredential
+	credential        *credentials.RsaKeyPairCredential
 	commonApi         func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
 }
 
@@ -38,7 +38,7 @@ type SessionAkCredential struct {
 	accessKeySecret string
 }
 
-func NewSignerKeyPair(credential *credentials.KeyPairCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerKeyPair, err error) {
+func NewSignerKeyPair(credential *credentials.RsaKeyPairCredential, commonApi func(*requests.CommonRequest, interface{}) (response *responses.CommonResponse, err error)) (signer *SignerKeyPair, err error) {
 	signer = &SignerKeyPair{
 		credential: credential,
 		commonApi:  commonApi,

+ 2 - 2
sdk/auth/signers/signer_sts_assume_role.go

@@ -35,7 +35,7 @@ type SignerStsAssumeRole struct {
 	*credentialUpdater
 	roleSessionName   string
 	sessionCredential *sessionCredential
-	credential        *credentials.StsAssumeRoleCredential
+	credential        *credentials.StsRoleArnCredential
 	commonApi         func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)
 }
 
@@ -45,7 +45,7 @@ type sessionCredential struct {
 	securityToken   string
 }
 
-func NewSignerStsAssumeRole(credential *credentials.StsAssumeRoleCredential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer *SignerStsAssumeRole, err error) {
+func NewSignerStsAssumeRole(credential *credentials.StsRoleArnCredential, commonApi func(request *requests.CommonRequest, signer interface{}) (response *responses.CommonResponse, err error)) (signer *SignerStsAssumeRole, err error) {
 	signer = &SignerStsAssumeRole{
 		credential: credential,
 		commonApi:  commonApi,

+ 2 - 2
sdk/auth/signers/signer_v2.go

@@ -19,14 +19,14 @@ import (
 )
 
 type SignerV2 struct {
-	credential *credentials.KeyPairCredential
+	credential *credentials.RsaKeyPairCredential
 }
 
 func (signer *SignerV2) GetExtraParam() map[string]string {
 	return nil
 }
 
-func NewSignerV2(credential *credentials.KeyPairCredential) (*SignerV2, error) {
+func NewSignerV2(credential *credentials.RsaKeyPairCredential) (*SignerV2, error) {
 	return &SignerV2{
 		credential: credential,
 	}, nil

+ 18 - 18
sdk/client.go

@@ -92,9 +92,9 @@ func (client *Client) InitWithAccessKey(regionId, accessKeyId, accessKeySecret s
 	return client.InitWithOptions(regionId, config, credential)
 }
 
-func (client *Client) InitWithRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) {
+func (client *Client) InitWithStsRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (err error) {
 	config := client.InitClientConfig()
-	credential := &credentials.StsAssumeRoleCredential{
+	credential := &credentials.StsRoleArnCredential{
 		AccessKeyId:     accessKeyId,
 		AccessKeySecret: accessKeySecret,
 		RoleArn:         roleArn,
@@ -103,9 +103,9 @@ func (client *Client) InitWithRoleArn(regionId, accessKeyId, accessKeySecret, ro
 	return client.InitWithOptions(regionId, config, credential)
 }
 
-func (client *Client) InitWithKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) {
+func (client *Client) InitWithRsaKeyPair(regionId, publicKeyId, privateKey string, sessionExpiration int) (err error) {
 	config := client.InitClientConfig()
-	credential := &credentials.KeyPairCredential{
+	credential := &credentials.RsaKeyPairCredential{
 		PrivateKey:        privateKey,
 		PublicKeyId:       publicKeyId,
 		SessionExpiration: sessionExpiration,
@@ -113,9 +113,9 @@ func (client *Client) InitWithKeyPair(regionId, publicKeyId, privateKey string,
 	return client.InitWithOptions(regionId, config, credential)
 }
 
-func (client *Client) InitWithEcsInstance(regionId, roleName string) (err error) {
+func (client *Client) InitWithStsRoleNameOnEcs(regionId, roleName string) (err error) {
 	config := client.InitClientConfig()
-	credential := &credentials.EcsInstanceCredential{
+	credential := &credentials.StsRoleNameOnEcsCredential{
 		RoleName: roleName,
 	}
 	return client.InitWithOptions(regionId, config, credential)
@@ -146,12 +146,12 @@ func (client *Client) DoActionWithSigner(request requests.AcsRequest, response r
 
 	// resolve endpoint
 	resolveParam := &endpoints.ResolveParam{
-		Domain:           request.GetDomain(),
-		Product:          request.GetProduct(),
-		RegionId:         client.regionId,
-		LocationProduct:  request.GetLocationServiceCode(),
-		LocationEndpoint: request.GetLocationEndpointType(),
-		CommonApi:        client.ProcessCommonRequest,
+		Domain:               request.GetDomain(),
+		Product:              request.GetProduct(),
+		RegionId:             regionId,
+		LocationProduct:      request.GetLocationServiceCode(),
+		LocationEndpointType: request.GetLocationEndpointType(),
+		CommonApi:            client.ProcessCommonRequest,
 	}
 	endpoint, err := endpoints.Resolve(resolveParam)
 	if err != nil {
@@ -247,24 +247,24 @@ func NewClientWithAccessKey(regionId, accessKeyId, accessKeySecret string) (clie
 	return
 }
 
-func NewClientWithKeyPair(regionId string, config *Config, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
+func NewClientWithRsaKeyPair(regionId string, config *Config, publicKeyId, privateKey string, sessionExpiration int) (client *Client, err error) {
 	client = &Client{}
 	client.config = config
-	err = client.InitWithKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
+	err = client.InitWithRsaKeyPair(regionId, publicKeyId, privateKey, sessionExpiration)
 	return
 }
 
-func NewClientWithEcsInstance(regionId string, config *Config, roleName string) (client *Client, err error) {
+func NewClientWithStsRoleNameOnEcs(regionId string, config *Config, roleName string) (client *Client, err error) {
 	client = &Client{}
 	client.config = config
-	err = client.InitWithEcsInstance(regionId, roleName)
+	err = client.InitWithStsRoleNameOnEcs(regionId, roleName)
 	return
 }
 
-func NewClientWithRoleArn(regionId string, config *Config, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
+func NewClientWithStsRoleArn(regionId string, config *Config, accessKeyId, accessKeySecret, roleArn, roleSessionName string) (client *Client, err error) {
 	client = &Client{}
 	client.config = config
-	err = client.InitWithRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
+	err = client.InitWithStsRoleArn(regionId, accessKeyId, accessKeySecret, roleArn, roleSessionName)
 	return
 }
 

+ 10 - 6
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"
@@ -81,7 +82,7 @@ func getConfigFromEnv() *TestConfig {
 		ChildAK:         os.Getenv("CHILD_AK"),
 		ChildSecret:     os.Getenv("CHILD_SECRET"),
 	}
-	if config.AccessKeyId == "" {
+	if config.AccessKeyId == "" || os.Getenv("ENV_TYPE") != "CI" {
 		return nil
 	} else {
 		return config
@@ -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,
@@ -109,16 +113,16 @@ func testSetup() {
 	if err != nil {
 		panic(err)
 	}
-	clientKeyPair, err = NewClientWithKeyPair("cn-hangzhou", clientConfig, testConfig.PublicKeyId, testConfig.PrivateKey, 3600)
+	clientKeyPair, err = NewClientWithRsaKeyPair("cn-hangzhou", clientConfig, testConfig.PublicKeyId, testConfig.PrivateKey, 3600)
 	clientKeyPair.config = clientConfig
 	if err != nil {
 		panic(err)
 	}
-	clientEcs, err = NewClientWithEcsInstance("cn-hangzhou", clientConfig, "conan")
+	clientEcs, err = NewClientWithStsRoleNameOnEcs("cn-hangzhou", clientConfig, "conan")
 	if err != nil {
 		panic(err)
 	}
-	clientRoleArn, err = NewClientWithRoleArn("cn-hangzhou", clientConfig, testConfig.ChildAK, testConfig.ChildSecret, testConfig.RoleArn, "clientTest")
+	clientRoleArn, err = NewClientWithStsRoleArn("cn-hangzhou", clientConfig, testConfig.ChildAK, testConfig.ChildSecret, testConfig.RoleArn, "clientTest")
 	if err != nil {
 		panic(err)
 	}
@@ -299,7 +303,7 @@ func getFtTestRpcRequest() (request *requests.RpcRequest) {
 func getFtTestRpcRequestForEndpointLocation() (request *requests.RpcRequest) {
 	request = &requests.RpcRequest{}
 	request.InitWithApiInfo("Ft", "2016-01-01", "TestRpcApi", "ft", "openAPI")
-	request.RegionId = "cn-hangzhou"
+	request.RegionId = "ft-cn-hangzhou"
 	request.QueryParams["QueryParam"] = "QueryParamValue"
 	return
 }

+ 2 - 3
sdk/endpoints/location_resolver.go

@@ -61,14 +61,13 @@ func (resolver *LocationResolver) TryResolve(param *ResolveParam) (endpoint stri
 
 	getEndpointRequest.QueryParams["Id"] = param.RegionId
 	getEndpointRequest.QueryParams["ServiceCode"] = param.LocationProduct
-	if len(param.LocationEndpoint) > 0 {
-		getEndpointRequest.QueryParams["Type"] = param.LocationEndpoint
+	if len(param.LocationEndpointType) > 0 {
+		getEndpointRequest.QueryParams["Type"] = param.LocationEndpointType
 	} else {
 		getEndpointRequest.QueryParams["Type"] = "openAPI"
 	}
 
 	response, err := param.CommonApi(getEndpointRequest)
-	//{"Endpoints":{"Endpoint":[{"Protocols":{"Protocols":["HTTP","HTTPS"]},"Type":"openAPI","Namespace":"26842","Id":"cn-hangzhou","SerivceCode":"apigateway","Endpoint":"apigateway.cn-hangzhou.aliyuncs.com"}]},"RequestId":"3287538B-19A0-4550-9995-143C5EDBD955","Success":true}
 	var getEndpointResponse GetEndpointResponse
 	if !response.IsSuccess() {
 		support = false

+ 6 - 6
sdk/endpoints/resolver.go

@@ -61,12 +61,12 @@ func getAllResolvers() []Resolver {
 }
 
 type ResolveParam struct {
-	Domain           string
-	Product          string
-	RegionId         string
-	LocationProduct  string
-	LocationEndpoint string
-	CommonApi        func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) `json:"-"`
+	Domain               string
+	Product              string
+	RegionId             string
+	LocationProduct      string
+	LocationEndpointType string
+	CommonApi            func(request *requests.CommonRequest) (response *responses.CommonResponse, err error) `json:"-"`
 }
 
 func (param *ResolveParam) String() string {

+ 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) {