Skip to content

Commit cc6bd5d

Browse files
author
cynthia.ding@oracle.com
committed
fix gofmt warnings
1 parent 29d31a8 commit cc6bd5d

9 files changed

Lines changed: 11 additions & 11 deletions

File tree

samples/adsclient/go/src/speedle/rest/authz/client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestIsAllowed(t *testing.T) {
1818
context := authz.RequestContext{
1919
Subject: &authz.Subject{
2020
Principals: []*authz.Principal{
21-
&authz.Principal{
21+
{
2222
Type: "user",
2323
Name: "alan.cao",
2424
},

samples/adsclient/go/src/speedle/rest/authz/client/example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func main() {
2121
context := authz.RequestContext{
2222
Subject: &authz.Subject{
2323
Principals: []*authz.Principal{
24-
&authz.Principal{
24+
{
2525
Type: "user",
2626
Name: "alan.cao",
2727
},

samples/embedded/expenses/speedle_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func Wrap(handler http.Handler, service, spdlLoc string) (http.HandlerFunc, erro
3232
reqCtx := ads.RequestContext{
3333
Subject: &ads.Subject{
3434
Principals: []*ads.Principal{
35-
&ads.Principal{
35+
{
3636
Type: "user",
3737
Name: user,
3838
},

samples/integration/docker-integration/plugin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func (plugin *speedleDockerPlugin) toRequestContext(req *authorization.Request)
7878
}
7979
subject := authz.Subject{
8080
Principals: []*authz.Principal{
81-
&authz.Principal{
81+
{
8282
Type: "user",
8383
Name: user,
8484
},

samples/integration/kubernetes-integration/webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ func (impl *handlerImpl) evaluatePolicies(clusterName string, req *v1beta1.Subje
462462

463463
subject := authz.Subject{
464464
Principals: []*authz.Principal{
465-
&authz.Principal{
465+
{
466466
Type: "user",
467467
Name: req.Spec.User,
468468
},

testutil/cmdTestUtil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (client *CmdClient) ExecuteCmd(parameter string, data *CmdTestData) error {
6060
func NewCmdClient() *CmdClient {
6161
var cmdStr string
6262
binPath := os.Getenv("GOPATH")
63-
if strings.Compare(string(binPath[len(binPath)-1:len(binPath)]), "/") != 0 {
63+
if strings.Compare(string(binPath[len(binPath)-1:]), "/") != 0 {
6464
binPath = binPath + "/"
6565
}
6666

@@ -80,7 +80,7 @@ func NewCmdClient() *CmdClient {
8080
func NewCmdClient_token(token string) *CmdClient {
8181
var cmdStr string
8282
binPath := os.Getenv("GOPATH")
83-
if strings.Compare(string(binPath[len(binPath)-1:len(binPath)]), "/") != 0 {
83+
if strings.Compare(string(binPath[len(binPath)-1:]), "/") != 0 {
8484
binPath = binPath + "/"
8585
}
8686

testutil/restTestUtil.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ func GetRestTestData_CreatePolicy(step string, srvName string, policyName string
621621
Name: policyName,
622622
Effect: effect,
623623
Permissions: []*pmsapi.Permission{
624-
&pmsapi.Permission{
624+
{
625625
Resource: resource,
626626
Actions: actions,
627627
},
@@ -633,7 +633,7 @@ func GetRestTestData_CreatePolicy(step string, srvName string, policyName string
633633
Name: policyName,
634634
Effect: effect,
635635
Permissions: []*pmsapi.Permission{
636-
&pmsapi.Permission{
636+
{
637637
Resource: resource,
638638
Actions: actions,
639639
},

testutil/testBase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func RunTestCases(t *testing.T, testcases *[]TestCase, ctx *TestContext) {
7979
//If test case name is like sleep_500, then it would sleep 500ms
8080
method := strings.ToLower(tc.Method)
8181
if strings.Contains(method, "sleep") {
82-
sleep, _ := strconv.Atoi(method[6:len(method)])
82+
sleep, _ := strconv.Atoi(method[6:])
8383
t.Logf("Sleep %d mill-secondes", sleep)
8484
time.Sleep(time.Duration(sleep) * time.Millisecond)
8585
continue

testutil/testUtil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ func postGetAllGrantedPermissions_rest(outputBody interface{}, expectedBody inte
592592

593593
res := make([]string, len(*outputPerms))
594594
j := 0
595-
for k, _ := range adjustMap {
595+
for k := range adjustMap {
596596
res[j] = k
597597
j++
598598
}

0 commit comments

Comments
 (0)