mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 11:34:17 +02:00
replace & with new()
This commit is contained in:
@@ -194,18 +194,18 @@ func (cluster *Cluster) getDefaultOptions() []elasticsearch.Option {
|
||||
}
|
||||
|
||||
func (cluster *Cluster) getTransport() elastictransport.Option {
|
||||
transport := &http.Transport{
|
||||
transport := new(http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
})
|
||||
|
||||
if cluster.DebugHTTP {
|
||||
return elastictransport.WithTransport(
|
||||
&DebugTransport{Transport: transport},
|
||||
new(DebugTransport{Transport: transport}),
|
||||
)
|
||||
}
|
||||
|
||||
return elastictransport.WithTransport(
|
||||
&CompatibilityTransport{Transport: transport},
|
||||
new(CompatibilityTransport{Transport: transport}),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
func NewConfig() *Config {
|
||||
return &Config{Clusters: map[string]*Cluster{}}
|
||||
return new(Config{Clusters: map[string]*Cluster{}})
|
||||
}
|
||||
|
||||
func getDefaultPath() string {
|
||||
@@ -216,7 +216,7 @@ func (conf *Config) LoadConfig() error {
|
||||
return fmt.Errorf("failed to read config file: %w", err)
|
||||
}
|
||||
|
||||
newconf := &Config{}
|
||||
newconf := new(Config{})
|
||||
|
||||
err = yaml.Unmarshal(data, newconf)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user