mirror of
https://github.com/pgsty/minio.git
synced 2026-07-19 12:10:24 +03:00
run gofumpt cleanup across code-base (#14015)
This commit is contained in:
@@ -106,7 +106,6 @@ type esClient interface {
|
||||
createIndex(ElasticsearchArgs) error
|
||||
ping(context.Context, ElasticsearchArgs) (bool, error)
|
||||
stop()
|
||||
|
||||
entryExists(context.Context, string, string) (bool, error)
|
||||
removeEntry(context.Context, string, string) error
|
||||
updateEntry(context.Context, string, string, event.Event) error
|
||||
@@ -408,7 +407,6 @@ func (c *esClientV7) getServerSupportStatus(ctx context.Context) (ESSupportStatu
|
||||
}
|
||||
}
|
||||
return ESSUnknown, "", fmt.Errorf("Unable to get ES Server Version - got INFO response: %v", m)
|
||||
|
||||
}
|
||||
|
||||
func (c *esClientV7) isAtleastV7() bool {
|
||||
|
||||
@@ -241,7 +241,6 @@ func (target *KafkaTarget) Close() error {
|
||||
|
||||
// Check if atleast one broker in cluster is active
|
||||
func (k KafkaArgs) pingBrokers() bool {
|
||||
|
||||
for _, broker := range k.Brokers {
|
||||
_, dErr := net.Dial("tcp", broker.String())
|
||||
if dErr == nil {
|
||||
@@ -276,7 +275,6 @@ func NewKafkaTarget(id string, args KafkaArgs, doneCh <-chan struct{}, loggerOnc
|
||||
config.Net.SASL.Enable = args.SASL.Enable
|
||||
|
||||
tlsConfig, err := saramatls.NewConfig(args.TLS.ClientTLSCert, args.TLS.ClientTLSKey)
|
||||
|
||||
if err != nil {
|
||||
target.loggerOnce(context.Background(), err, target.ID())
|
||||
return target, err
|
||||
|
||||
@@ -240,7 +240,6 @@ func (target *MySQLTarget) send(eventData event.Event) error {
|
||||
|
||||
// Send - reads an event from store and sends it to MySQL.
|
||||
func (target *MySQLTarget) Send(eventKey string) error {
|
||||
|
||||
_, err := target.IsActive()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -298,7 +297,6 @@ func (target *MySQLTarget) Close() error {
|
||||
|
||||
// Executes the table creation statements.
|
||||
func (target *MySQLTarget) executeStmts() error {
|
||||
|
||||
_, err := target.db.Exec(fmt.Sprintf(mysqlTableExists, target.args.Table))
|
||||
if err != nil {
|
||||
createStmt := mysqlCreateNamespaceTable
|
||||
@@ -329,7 +327,6 @@ func (target *MySQLTarget) executeStmts() error {
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
// NewMySQLTarget - creates new MySQL target.
|
||||
|
||||
@@ -31,9 +31,11 @@ func TestNatsConnPlain(t *testing.T) {
|
||||
|
||||
clientConfig := &NATSArgs{
|
||||
Enable: true,
|
||||
Address: xnet.Host{Name: "localhost",
|
||||
Address: xnet.Host{
|
||||
Name: "localhost",
|
||||
Port: (xnet.Port(opts.Port)),
|
||||
IsPortSet: true},
|
||||
IsPortSet: true,
|
||||
},
|
||||
Subject: "test",
|
||||
}
|
||||
con, err := clientConfig.connectNats()
|
||||
@@ -53,9 +55,11 @@ func TestNatsConnUserPass(t *testing.T) {
|
||||
|
||||
clientConfig := &NATSArgs{
|
||||
Enable: true,
|
||||
Address: xnet.Host{Name: "localhost",
|
||||
Address: xnet.Host{
|
||||
Name: "localhost",
|
||||
Port: (xnet.Port(opts.Port)),
|
||||
IsPortSet: true},
|
||||
IsPortSet: true,
|
||||
},
|
||||
Subject: "test",
|
||||
Username: opts.Username,
|
||||
Password: opts.Password,
|
||||
@@ -77,9 +81,11 @@ func TestNatsConnToken(t *testing.T) {
|
||||
|
||||
clientConfig := &NATSArgs{
|
||||
Enable: true,
|
||||
Address: xnet.Host{Name: "localhost",
|
||||
Address: xnet.Host{
|
||||
Name: "localhost",
|
||||
Port: (xnet.Port(opts.Port)),
|
||||
IsPortSet: true},
|
||||
IsPortSet: true,
|
||||
},
|
||||
Subject: "test",
|
||||
Token: opts.Authorization,
|
||||
}
|
||||
|
||||
@@ -31,9 +31,11 @@ func TestNatsConnTLSCustomCA(t *testing.T) {
|
||||
|
||||
clientConfig := &NATSArgs{
|
||||
Enable: true,
|
||||
Address: xnet.Host{Name: "localhost",
|
||||
Address: xnet.Host{
|
||||
Name: "localhost",
|
||||
Port: (xnet.Port(opts.Port)),
|
||||
IsPortSet: true},
|
||||
IsPortSet: true,
|
||||
},
|
||||
Subject: "test",
|
||||
Secure: true,
|
||||
CertAuthority: path.Join("testdata", "contrib", "certs", "root_ca_cert.pem"),
|
||||
@@ -52,9 +54,11 @@ func TestNatsConnTLSClientAuthorization(t *testing.T) {
|
||||
|
||||
clientConfig := &NATSArgs{
|
||||
Enable: true,
|
||||
Address: xnet.Host{Name: "localhost",
|
||||
Address: xnet.Host{
|
||||
Name: "localhost",
|
||||
Port: (xnet.Port(opts.Port)),
|
||||
IsPortSet: true},
|
||||
IsPortSet: true,
|
||||
},
|
||||
Subject: "test",
|
||||
Secure: true,
|
||||
CertAuthority: path.Join("testdata", "contrib", "certs", "root_ca_cert.pem"),
|
||||
|
||||
@@ -296,7 +296,6 @@ func (target *PostgreSQLTarget) Close() error {
|
||||
|
||||
// Executes the table creation statements.
|
||||
func (target *PostgreSQLTarget) executeStmts() error {
|
||||
|
||||
_, err := target.db.Exec(fmt.Sprintf(psqlTableExists, target.args.Table))
|
||||
if err != nil {
|
||||
createStmt := psqlCreateNamespaceTable
|
||||
|
||||
@@ -59,7 +59,7 @@ func (store *QueueStore) Open() error {
|
||||
store.Lock()
|
||||
defer store.Unlock()
|
||||
|
||||
if err := os.MkdirAll(store.directory, os.FileMode(0770)); err != nil {
|
||||
if err := os.MkdirAll(store.directory, os.FileMode(0o770)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ func (store *QueueStore) Open() error {
|
||||
|
||||
// write - writes event to the directory.
|
||||
func (store *QueueStore) write(key string, e event.Event) error {
|
||||
|
||||
// Marshalls the event.
|
||||
eventData, err := json.Marshal(e)
|
||||
if err != nil {
|
||||
@@ -88,7 +87,7 @@ func (store *QueueStore) write(key string, e event.Event) error {
|
||||
}
|
||||
|
||||
path := filepath.Join(store.directory, key+eventExt)
|
||||
if err := ioutil.WriteFile(path, eventData, os.FileMode(0770)); err != nil {
|
||||
if err := ioutil.WriteFile(path, eventData, os.FileMode(0o770)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ func TestQueueStorePut(t *testing.T) {
|
||||
store, err := setUpStore(queueDir, 100)
|
||||
if err != nil {
|
||||
t.Fatal("Failed to create a queue store ", err)
|
||||
|
||||
}
|
||||
// Put 100 events.
|
||||
for i := 0; i < 100; i++ {
|
||||
|
||||
Reference in New Issue
Block a user