See how Boundary would look with gofumpt applied (#853)

* See how Boundary would look with https://github.com/mvdan/gofumpt applied

Results of running `gofumpt -w -s .`

* Update tools file and Makefile for gofumpt

Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
This commit is contained in:
Michael GaffneyandJeff Mitchell authored and GitHub committed 2021-01-07 10:02:32 -05:00
1 parent cca0fbea2b
commit 94cb79bbdd
237 files changed
+1567 -1529

No files matched your search

+4 -2
View File
@@ -48,8 +48,10 @@ func (c *Connection) GetPublicId() string {
return c.PublicId
}
var _ Cloneable = (*Connection)(nil)
var _ db.VetForWriter = (*Connection)(nil)
var (
_ Cloneable = (*Connection)(nil)
_ db.VetForWriter = (*Connection)(nil)
)
// New creates a new in memory session. No options
// are currently supported.
@@ -22,6 +22,7 @@ const (
func (r ClosedReason) String() string {
return string(r)
}
func convertToClosedReason(s string) (ClosedReason, error) {
switch s {
case UnknownReason.String():
+4 -2
View File
@@ -59,8 +59,10 @@ type ConnectionState struct {
tableName string `gorm:"-"`
}
var _ Cloneable = (*ConnectionState)(nil)
var _ db.VetForWriter = (*ConnectionState)(nil)
var (
_ Cloneable = (*ConnectionState)(nil)
_ db.VetForWriter = (*ConnectionState)(nil)
)
// NewConnectionState creates a new in memory connection state. No options
// are currently supported.
+4 -6
View File
@@ -24,7 +24,7 @@ func TestSession_ImmutableFields(t *testing.T) {
_, _ = iam.TestScopes(t, iam.TestRepo(t, conn, wrapper))
new := TestDefaultSession(t, conn, wrapper, iamRepo)
var tests = []struct {
tests := []struct {
name string
update *Session
fieldMask []string
@@ -83,7 +83,6 @@ func TestSession_ImmutableFields(t *testing.T) {
require.NoError(err)
assert.Equal(orig.(*Session), after)
})
}
}
@@ -105,7 +104,7 @@ func TestState_ImmutableFields(t *testing.T) {
err := rw.LookupWhere(context.Background(), &new, "session_id = ? and state = ?", state.SessionId, state.Status)
require.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
update *State
fieldMask []string
@@ -180,7 +179,7 @@ func TestConnection_ImmutableFields(t *testing.T) {
session := TestDefaultSession(t, conn, wrapper, iamRepo)
new := TestConnection(t, conn, session.PublicId, "127.0.0.1", 22, "127.0.0.1", 2222)
var tests = []struct {
tests := []struct {
name string
update *Connection
fieldMask []string
@@ -230,7 +229,6 @@ func TestConnection_ImmutableFields(t *testing.T) {
require.NoError(err)
assert.Equal(orig.(*Connection), after)
})
}
}
@@ -253,7 +251,7 @@ func TestConnectionState_ImmutableFields(t *testing.T) {
err := rw.LookupWhere(context.Background(), &new, "connection_id = ? and state = ?", state.ConnectionId, state.Status)
require.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
update *ConnectionState
fieldMask []string
+2 -1
View File
@@ -104,7 +104,8 @@ func (r *Repository) convertToSessions(ctx context.Context, sessionsWithState []
Version: sv.Version,
Endpoint: sv.Endpoint,
ConnectionLimit: sv.ConnectionLimit,
KeyId: sv.KeyId}
KeyId: sv.KeyId,
}
if opts.withListingConvert {
workingSession.CtTofuToken = nil // CtTofuToken should not returned in lists
workingSession.TofuToken = nil // TofuToken should not returned in lists
@@ -1008,7 +1008,6 @@ func TestRepository_CloseConnections(t *testing.T) {
cw := setupFn(2)
cw[1].ConnectionId = ""
return cw
}(),
reason: ClosedByUser,
wantErr: true,
+4 -2
View File
@@ -106,8 +106,10 @@ func (s *Session) GetPublicId() string {
return s.PublicId
}
var _ Cloneable = (*Session)(nil)
var _ db.VetForWriter = (*Session)(nil)
var (
_ Cloneable = (*Session)(nil)
_ db.VetForWriter = (*Session)(nil)
)
// New creates a new in memory session.
func New(c ComposedOf, opt ...Option) (*Session, error) {
+4 -2
View File
@@ -62,8 +62,10 @@ type State struct {
tableName string `gorm:"-"`
}
var _ Cloneable = (*State)(nil)
var _ db.VetForWriter = (*State)(nil)
var (
_ Cloneable = (*State)(nil)
_ db.VetForWriter = (*State)(nil)
)
// NewState creates a new in memory session state. No options
// are currently supported.
+1
View File
@@ -24,6 +24,7 @@ const (
func (r TerminationReason) String() string {
return string(r)
}
func convertToReason(s string) (TerminationReason, error) {
switch s {
case UnknownTermination.String():
+1
View File
@@ -76,6 +76,7 @@ func Test_TestWorker(t *testing.T) {
w := TestWorker(t, conn, wrapper)
require.NotNil(w)
}
func Test_TestCert(t *testing.T) {
t.Helper()
assert, require := assert.New(t), require.New(t)