From 38205039799b501041e9122cee0bd2e48fbaf3d7 Mon Sep 17 00:00:00 2001 From: Jim Date: Tue, 29 Jun 2021 06:59:31 -0400 Subject: [PATCH] "make fmt" updates --- internal/cmd/commands/connect/connect.go | 2 +- internal/servers/worker/session_test.go | 46 ++++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/internal/cmd/commands/connect/connect.go b/internal/cmd/commands/connect/connect.go index dba4f07fdb..0da55cef0e 100644 --- a/internal/cmd/commands/connect/connect.go +++ b/internal/cmd/commands/connect/connect.go @@ -536,7 +536,7 @@ func (c *Command) Run(args []string) (retCode int) { Expiration: c.expiration, ConnectionLimit: c.sessionAuthzData.GetConnectionLimit(), SessionId: c.sessionAuthzData.GetSessionId(), - Credentials: creds, + Credentials: creds, } switch base.Format(c.UI) { case "table": diff --git a/internal/servers/worker/session_test.go b/internal/servers/worker/session_test.go index fb48acbfca..4d89038fd8 100644 --- a/internal/servers/worker/session_test.go +++ b/internal/servers/worker/session_test.go @@ -34,10 +34,10 @@ func TestMakeSessionCloseInfo(t *testing.T) { }, } expected := map[string][]*pbs.CloseConnectionResponseData{ - "one": []*pbs.CloseConnectionResponseData{ + "one": { {ConnectionId: "foo", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, - "two": []*pbs.CloseConnectionResponseData{ + "two": { {ConnectionId: "bar", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, } @@ -72,10 +72,10 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { { name: "basic", sessionCloseInfo: map[string][]*pbs.CloseConnectionResponseData{ - "one": []*pbs.CloseConnectionResponseData{ + "one": { {ConnectionId: "foo", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, - "two": []*pbs.CloseConnectionResponseData{ + "two": { {ConnectionId: "bar", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, }, @@ -84,19 +84,19 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { m.Store("one", &sessionInfo{ id: "one", connInfoMap: map[string]*connInfo{ - "foo": &connInfo{id: "foo"}, + "foo": {id: "foo"}, }, }) m.Store("two", &sessionInfo{ id: "two", connInfoMap: map[string]*connInfo{ - "bar": &connInfo{id: "bar"}, + "bar": {id: "bar"}, }, }) m.Store("three", &sessionInfo{ id: "three", connInfoMap: map[string]*connInfo{ - "baz": &connInfo{id: "baz"}, + "baz": {id: "baz"}, }, }) @@ -104,17 +104,17 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { }, expected: []string{"foo", "bar"}, expectedClosed: map[string]struct{}{ - "foo": struct{}{}, - "bar": struct{}{}, + "foo": {}, + "bar": {}, }, }, { name: "not closed", sessionCloseInfo: map[string][]*pbs.CloseConnectionResponseData{ - "one": []*pbs.CloseConnectionResponseData{ + "one": { {ConnectionId: "foo", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, - "two": []*pbs.CloseConnectionResponseData{ + "two": { {ConnectionId: "bar", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CONNECTED}, }, }, @@ -123,13 +123,13 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { m.Store("one", &sessionInfo{ id: "one", connInfoMap: map[string]*connInfo{ - "foo": &connInfo{id: "foo"}, + "foo": {id: "foo"}, }, }) m.Store("two", &sessionInfo{ id: "two", connInfoMap: map[string]*connInfo{ - "bar": &connInfo{id: "bar"}, + "bar": {id: "bar"}, }, }) @@ -137,16 +137,16 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { }, expected: []string{"foo"}, expectedClosed: map[string]struct{}{ - "foo": struct{}{}, + "foo": {}, }, }, { name: "missing session", sessionCloseInfo: map[string][]*pbs.CloseConnectionResponseData{ - "one": []*pbs.CloseConnectionResponseData{ + "one": { {ConnectionId: "foo", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, - "two": []*pbs.CloseConnectionResponseData{ + "two": { {ConnectionId: "bar", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, }, @@ -155,7 +155,7 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { m.Store("one", &sessionInfo{ id: "one", connInfoMap: map[string]*connInfo{ - "foo": &connInfo{id: "foo"}, + "foo": {id: "foo"}, }, }) @@ -163,7 +163,7 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { }, expected: []string{"foo"}, expectedClosed: map[string]struct{}{ - "foo": struct{}{}, + "foo": {}, }, expectedErr: []error{ errors.New(`could not find session ID "two" in local state after closing connections`), @@ -172,10 +172,10 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { { name: "missing connection", sessionCloseInfo: map[string][]*pbs.CloseConnectionResponseData{ - "one": []*pbs.CloseConnectionResponseData{ + "one": { {ConnectionId: "foo", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, - "two": []*pbs.CloseConnectionResponseData{ + "two": { {ConnectionId: "bar", Status: pbs.CONNECTIONSTATUS_CONNECTIONSTATUS_CLOSED}, }, }, @@ -184,7 +184,7 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { m.Store("one", &sessionInfo{ id: "one", connInfoMap: map[string]*connInfo{ - "foo": &connInfo{id: "foo"}, + "foo": {id: "foo"}, }, }) m.Store("two", &sessionInfo{id: "two"}) @@ -193,7 +193,7 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { }, expected: []string{"foo"}, expectedClosed: map[string]struct{}{ - "foo": struct{}{}, + "foo": {}, }, expectedErr: []error{ errors.New(`could not find connection ID "bar" for session ID "two" in local state after closing connections`), @@ -207,7 +207,7 @@ func TestWorkerSetCloseTimeForResponse(t *testing.T) { m.Store("one", &sessionInfo{ id: "one", connInfoMap: map[string]*connInfo{ - "foo": &connInfo{id: "foo"}, + "foo": {id: "foo"}, }, })