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

+1 -1
View File
@@ -23,7 +23,7 @@ func TestHostCatalog_New(t *testing.T) {
opts []Option
}
var tests = []struct {
tests := []struct {
name string
args args
want *HostCatalog
+1 -1
View File
@@ -25,7 +25,7 @@ func TestHostSetMember_Insert(t *testing.T) {
greenCat := cats[1]
greenSets := TestSets(t, conn, greenCat.GetPublicId(), 1)
var tests = []struct {
tests := []struct {
name string
set *HostSet
host *Host
+1 -1
View File
@@ -23,7 +23,7 @@ func TestHostSet_New(t *testing.T) {
opts []Option
}
var tests = []struct {
tests := []struct {
name string
args args
want *HostSet
+1 -1
View File
@@ -23,7 +23,7 @@ func TestHost_New(t *testing.T) {
opts []Option
}
var tests = []struct {
tests := []struct {
name string
args args
want *Host
@@ -23,7 +23,7 @@ func TestHostCatalog_ImmutableFields(t *testing.T) {
o, prj := iam.TestScopes(t, iam.TestRepo(t, conn, wrapper))
new := testCatalog(t, conn, prj.PublicId)
var tests = []struct {
tests := []struct {
name string
update *HostCatalog
fieldMask []string
@@ -73,7 +73,6 @@ func TestHostCatalog_ImmutableFields(t *testing.T) {
require.NoError(err)
assert.True(proto.Equal(orig, after))
})
}
}
@@ -91,7 +90,7 @@ func TestStaticHost_ImmutableFields(t *testing.T) {
new := hosts[0]
var tests = []struct {
tests := []struct {
name string
update *Host
fieldMask []string
@@ -141,7 +140,6 @@ func TestStaticHost_ImmutableFields(t *testing.T) {
require.NoError(err)
assert.True(proto.Equal(orig, after))
})
}
}
@@ -166,7 +164,7 @@ func TestStaticHostSet_ImmutableFields(t *testing.T) {
new := sets[0]
var tests = []struct {
tests := []struct {
name string
update *HostSet
fieldMask []string
@@ -216,7 +214,6 @@ func TestStaticHostSet_ImmutableFields(t *testing.T) {
require.NoError(err)
assert.True(proto.Equal(orig, after))
})
}
}
@@ -244,7 +241,7 @@ func TestStaticHostSetMember_ImmutableFields(t *testing.T) {
err = w.Create(context.Background(), new)
assert.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
update *HostSetMember
fieldMask []string
@@ -285,7 +282,6 @@ func TestStaticHostSetMember_ImmutableFields(t *testing.T) {
require.NoError(err)
assert.True(proto.Equal(orig, after))
})
}
}
@@ -20,7 +20,7 @@ func TestRepository_CreateCatalog(t *testing.T) {
rw := db.New(conn)
wrapper := db.TestWrapper(t)
var tests = []struct {
tests := []struct {
name string
in *HostCatalog
opts []Option
@@ -229,7 +229,7 @@ func TestRepository_UpdateCatalog(t *testing.T) {
}
}
var tests = []struct {
tests := []struct {
name string
orig *HostCatalog
chgFn func(*HostCatalog) *HostCatalog
@@ -575,7 +575,7 @@ func TestRepository_LookupCatalog(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, badId)
var tests = []struct {
tests := []struct {
name string
id string
want *HostCatalog
@@ -637,7 +637,7 @@ func TestRepository_DeleteCatalog(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, badId)
var tests = []struct {
tests := []struct {
name string
id string
want int
@@ -216,7 +216,6 @@ func (r *Repository) LookupSet(ctx context.Context, publicId string, opt ...Opti
}
return nil
})
if err != nil {
return nil, nil, errors.Wrap(err, op, errors.WithMsg(fmt.Sprintf("in %s", s.PublicId)))
}
@@ -413,7 +413,7 @@ func TestRepository_SetSetMembers_Parameters(t *testing.T) {
// hostsA has the first 3 hosts, hostsB has the last 3 hosts
// the middle host is shared in both.
hostsA, hostsB := hosts[:3], hosts[2:]
//hostsA is the initial set of hosts in the host set
// hostsA is the initial set of hosts in the host set
TestSetMembers(t, conn, set.PublicId, hostsA)
var hostIds []string
@@ -28,7 +28,7 @@ func TestRepository_CreateSet(t *testing.T) {
_, prj := iam.TestScopes(t, iamRepo)
catalog := TestCatalogs(t, conn, prj.PublicId, 1)[0]
var tests = []struct {
tests := []struct {
name string
in *HostSet
opts []Option
@@ -257,7 +257,7 @@ func TestRepository_UpdateSet(t *testing.T) {
}
}
var tests = []struct {
tests := []struct {
name string
orig *HostSet
chgFn func(*HostSet) *HostSet
@@ -638,7 +638,7 @@ func TestRepository_UpdateSet_Limits(t *testing.T) {
hosts := TestHosts(t, conn, catalog.PublicId, count)
TestSetMembers(t, conn, hostSet.PublicId, hosts)
var tests = []struct {
tests := []struct {
name string
repoOpts []Option
updateOpts []Option
@@ -719,7 +719,7 @@ func TestRepository_LookupSet(t *testing.T) {
hostSetId, err := newHostSetId()
require.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
in string
want *HostSet
@@ -787,7 +787,7 @@ func TestRepository_LookupSet_Limits(t *testing.T) {
hosts := TestHosts(t, conn, catalog.PublicId, count)
TestSetMembers(t, conn, hostSet.PublicId, hosts)
var tests = []struct {
tests := []struct {
name string
repoOpts []Option
lookupOpts []Option
@@ -859,7 +859,7 @@ func TestRepository_ListSets(t *testing.T) {
hostSets := TestSets(t, conn, catalogA.PublicId, 3)
var tests = []struct {
tests := []struct {
name string
in string
opts []Option
@@ -917,7 +917,7 @@ func TestRepository_ListSets_Limits(t *testing.T) {
count := 10
hostSets := TestSets(t, conn, catalog.PublicId, count)
var tests = []struct {
tests := []struct {
name string
repoOpts []Option
listOpts []Option
@@ -988,7 +988,7 @@ func TestRepository_DeleteSet(t *testing.T) {
newHostSetId, err := newHostSetId()
require.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
in string
want int
+6 -6
View File
@@ -28,7 +28,7 @@ func TestRepository_CreateHost(t *testing.T) {
_, prj := iam.TestScopes(t, iamRepo)
catalog := TestCatalogs(t, conn, prj.PublicId, 1)[0]
var tests = []struct {
tests := []struct {
name string
in *Host
opts []Option
@@ -313,7 +313,7 @@ func TestRepository_UpdateHost(t *testing.T) {
}
}
var tests = []struct {
tests := []struct {
name string
orig *Host
chgFn func(*Host) *Host
@@ -755,7 +755,7 @@ func TestRepository_LookupHost(t *testing.T) {
hostId, err := newHostId()
require.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
in string
want *Host
@@ -808,7 +808,7 @@ func TestRepository_ListHosts(t *testing.T) {
hosts := TestHosts(t, conn, catalogA.PublicId, 3)
var tests = []struct {
tests := []struct {
name string
in string
opts []Option
@@ -866,7 +866,7 @@ func TestRepository_ListHosts_Limits(t *testing.T) {
count := 10
hosts := TestHosts(t, conn, catalog.PublicId, count)
var tests = []struct {
tests := []struct {
name string
repoOpts []Option
listOpts []Option
@@ -937,7 +937,7 @@ func TestRepository_DeleteHost(t *testing.T) {
newHostId, err := newHostId()
require.NoError(t, err)
var tests = []struct {
tests := []struct {
name string
in string
want int
+1 -1
View File
@@ -24,7 +24,7 @@ func TestRepository_New(t *testing.T) {
opts []Option
}
var tests = []struct {
tests := []struct {
name string
args args
want *Repository
+14 -10
View File
@@ -10,12 +10,13 @@
package store
import (
reflect "reflect"
sync "sync"
timestamp "github.com/hashicorp/boundary/internal/db/timestamp"
_ "github.com/hashicorp/boundary/internal/gen/controller/protooptions"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
@@ -543,14 +544,17 @@ func file_controller_storage_host_static_store_v1_static_proto_rawDescGZIP() []b
return file_controller_storage_host_static_store_v1_static_proto_rawDescData
}
var file_controller_storage_host_static_store_v1_static_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_controller_storage_host_static_store_v1_static_proto_goTypes = []interface{}{
(*HostCatalog)(nil), // 0: controller.storage.host.static.store.v1.HostCatalog
(*Host)(nil), // 1: controller.storage.host.static.store.v1.Host
(*HostSet)(nil), // 2: controller.storage.host.static.store.v1.HostSet
(*HostSetMember)(nil), // 3: controller.storage.host.static.store.v1.HostSetMember
(*timestamp.Timestamp)(nil), // 4: controller.storage.timestamp.v1.Timestamp
}
var (
file_controller_storage_host_static_store_v1_static_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
file_controller_storage_host_static_store_v1_static_proto_goTypes = []interface{}{
(*HostCatalog)(nil), // 0: controller.storage.host.static.store.v1.HostCatalog
(*Host)(nil), // 1: controller.storage.host.static.store.v1.Host
(*HostSet)(nil), // 2: controller.storage.host.static.store.v1.HostSet
(*HostSetMember)(nil), // 3: controller.storage.host.static.store.v1.HostSetMember
(*timestamp.Timestamp)(nil), // 4: controller.storage.timestamp.v1.Timestamp
}
)
var file_controller_storage_host_static_store_v1_static_proto_depIdxs = []int32{
4, // 0: controller.storage.host.static.store.v1.HostCatalog.create_time:type_name -> controller.storage.timestamp.v1.Timestamp
4, // 1: controller.storage.host.static.store.v1.HostCatalog.update_time:type_name -> controller.storage.timestamp.v1.Timestamp