Run a more strict formatter over the code (#11312)

* Update tooling

* Run gofumpt

* go mod vendor
This commit is contained in:
Brian Kassouf
2021-04-08 09:43:39 -07:00
committed by GitHub
parent 60f3ba99a4
commit a24653cc5c
658 changed files with 10961 additions and 3671 deletions

View File

@@ -66,7 +66,7 @@ func TestBackendHandleRequest(t *testing.T) {
{
Pattern: "foo/bar",
Fields: map[string]*FieldSchema{
"value": &FieldSchema{Type: TypeInt},
"value": {Type: TypeInt},
},
Callbacks: map[logical.Operation]OperationFunc{
logical.ReadOperation: callback,
@@ -75,7 +75,7 @@ func TestBackendHandleRequest(t *testing.T) {
{
Pattern: "foo/baz/handler",
Fields: map[string]*FieldSchema{
"amount": &FieldSchema{Type: TypeInt},
"amount": {Type: TypeInt},
},
Operations: map[logical.Operation]OperationHandler{
logical.ReadOperation: &PathOperation{Callback: handler},
@@ -84,7 +84,7 @@ func TestBackendHandleRequest(t *testing.T) {
{
Pattern: "foo/both/handler",
Fields: map[string]*FieldSchema{
"amount": &FieldSchema{Type: TypeInt},
"amount": {Type: TypeInt},
},
Callbacks: map[logical.Operation]OperationFunc{
logical.ReadOperation: callback,
@@ -228,10 +228,10 @@ func TestBackendHandleRequest_badwrite(t *testing.T) {
b := &Backend{
Paths: []*Path{
&Path{
{
Pattern: "foo/bar",
Fields: map[string]*FieldSchema{
"value": &FieldSchema{Type: TypeBool},
"value": {Type: TypeBool},
},
Callbacks: map[logical.Operation]OperationFunc{
logical.UpdateOperation: callback,
@@ -249,7 +249,6 @@ func TestBackendHandleRequest_badwrite(t *testing.T) {
if err == nil {
t.Fatalf("should have thrown a conversion error")
}
}
func TestBackendHandleRequest_404(t *testing.T) {
@@ -263,10 +262,10 @@ func TestBackendHandleRequest_404(t *testing.T) {
b := &Backend{
Paths: []*Path{
&Path{
{
Pattern: `foo/bar`,
Fields: map[string]*FieldSchema{
"value": &FieldSchema{Type: TypeInt},
"value": {Type: TypeInt},
},
Callbacks: map[logical.Operation]OperationFunc{
logical.ReadOperation: callback,
@@ -288,10 +287,10 @@ func TestBackendHandleRequest_404(t *testing.T) {
func TestBackendHandleRequest_help(t *testing.T) {
b := &Backend{
Paths: []*Path{
&Path{
{
Pattern: "foo/bar",
Fields: map[string]*FieldSchema{
"value": &FieldSchema{Type: TypeInt},
"value": {Type: TypeInt},
},
HelpSynopsis: "foo",
HelpDescription: "bar",
@@ -360,6 +359,7 @@ func TestBackendHandleRequest_renewAuthCallback(t *testing.T) {
t.Fatalf("bad: %#v", v)
}
}
func TestBackendHandleRequest_renew(t *testing.T) {
called := new(uint32)
callback := func(context.Context, *logical.Request, *FieldData) (*logical.Response, error) {
@@ -485,10 +485,10 @@ func TestBackendHandleRequest_unsupportedOperation(t *testing.T) {
b := &Backend{
Paths: []*Path{
&Path{
{
Pattern: `foo/bar`,
Fields: map[string]*FieldSchema{
"value": &FieldSchema{Type: TypeInt},
"value": {Type: TypeInt},
},
Callbacks: map[logical.Operation]OperationFunc{
logical.ReadOperation: callback,
@@ -518,10 +518,10 @@ func TestBackendHandleRequest_urlPriority(t *testing.T) {
b := &Backend{
Paths: []*Path{
&Path{
{
Pattern: `foo/(?P<value>\d+)`,
Fields: map[string]*FieldSchema{
"value": &FieldSchema{Type: TypeInt},
"value": {Type: TypeInt},
},
Callbacks: map[logical.Operation]OperationFunc{
logical.ReadOperation: callback,
@@ -613,13 +613,13 @@ func TestBackendSecret(t *testing.T) {
Match bool
}{
"no match": {
[]*Secret{&Secret{Type: "foo"}},
[]*Secret{{Type: "foo"}},
"bar",
false,
},
"match": {
[]*Secret{&Secret{Type: "foo"}},
[]*Secret{{Type: "foo"}},
"foo",
true,
},
@@ -747,7 +747,6 @@ func TestFieldSchemaDefaultOrZero(t *testing.T) {
}
func TestInitializeBackend(t *testing.T) {
var inited bool
backend := &Backend{InitializeFunc: func(context.Context, *logical.InitializationRequest) error {
inited = true