Linter fixes PR 3 (#4415)

* Linter fixes

* fix(bsr): update test to register TEST protocol once

---------

Co-authored-by: Damian Debkowski <damian.debkowski@hashicorp.com>
This commit is contained in:
Jeff MitchellandDamian Debkowski authored and GitHub committed 2024-02-16 08:30:16 -05:00
1 parent e95eda7ca2
commit 35cef97bd4
119 files changed
+365 -300

No files matched your search

+1 -1
View File
@@ -528,7 +528,7 @@ func (c *InitCommand) verifyOplogIsEmpty(ctx context.Context) error {
const op = "database.(InitCommand).verifyOplogIsEmpty"
underlyingDB, err := c.Database.SqlDB(ctx)
if err != nil {
return errors.New(ctx, errors.Internal, op, "unable to retreive db", errors.WithWrap(err))
return errors.New(ctx, errors.Internal, op, "unable to retrieve db", errors.WithWrap(err))
}
r := underlyingDB.QueryRowContext(c.Context, "select not exists(select 1 from oplog_entry limit 1)")
if r.Err() != nil {
+2 -2
View File
@@ -272,10 +272,10 @@ func RunCustom(args []string, runOpts *RunOptions) (exitCode int) {
return exitCode
}
if !strings.Contains(api.LastOutputStringError.Error(), api.ErrOutputStringRequest) {
runOpts.Stdout.Write([]byte(fmt.Sprintf("Error creating request string: %s\n", api.LastOutputStringError.Error())))
_, _ = runOpts.Stdout.Write([]byte(fmt.Sprintf("Error creating request string: %s\n", api.LastOutputStringError.Error())))
return 1
}
runOpts.Stdout.Write([]byte(fmt.Sprintf("%s\n", api.LastOutputStringError.CurlString())))
_, _ = runOpts.Stdout.Write([]byte(fmt.Sprintf("%s\n", api.LastOutputStringError.CurlString())))
return 0
}
} else if err != nil {
+11 -4
View File
@@ -143,7 +143,8 @@ func TestNewServerIntegration(t *testing.T) {
},
},
assertions: func(t *testing.T, addrs []string) {
_, err := http.Get("http://" + addrs[0])
resp, err := http.Get("http://" + addrs[0])
resp.Body.Close()
require.NoError(t, err)
},
},
@@ -164,10 +165,12 @@ func TestNewServerIntegration(t *testing.T) {
},
},
assertions: func(t *testing.T, addrs []string) {
_, err := http.Get("http://" + addrs[0])
resp, err := http.Get("http://" + addrs[0])
resp.Body.Close()
require.NoError(t, err)
_, err = http.Get("http://" + addrs[1])
resp, err = http.Get("http://" + addrs[1])
resp.Body.Close()
require.NoError(t, err)
},
},
@@ -288,7 +291,11 @@ func TestNewServerIntegration(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, s)
s.Start()
t.Cleanup(func() { s.Shutdown() })
t.Cleanup(func() {
if err := s.Shutdown(); err != nil {
t.Logf("error shutting down: %v", err)
}
})
addrs := make([]string, 0, len(s.bundles))
for _, b := range s.bundles {