mirror of
https://codeberg.org/scip/esctl.git
synced 2026-08-24 09:54:18 +02:00
replace & with new()
This commit is contained in:
@@ -159,7 +159,7 @@ func ApiRepl(conf *cfg.Config) error {
|
||||
}
|
||||
|
||||
func pageJsonOutput(conf *cfg.Config, raw []byte) {
|
||||
tmpconf := &cfg.Config{HaveJQ: conf.HaveJQ}
|
||||
tmpconf := new(cfg.Config{HaveJQ: conf.HaveJQ})
|
||||
|
||||
if conf.Pager != "" {
|
||||
tmpconf.HaveJQ = false
|
||||
@@ -207,16 +207,16 @@ func CallAPI(conf *cfg.Config, verb, path, data string) ([]byte, error) {
|
||||
verb = strings.ToUpper(verb)
|
||||
|
||||
// we're using port-forwards anyway
|
||||
noVerifyTransport := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
noVerifyTransport := new(http.Transport{
|
||||
TLSClientConfig: new(tls.Config{InsecureSkipVerify: true}),
|
||||
})
|
||||
|
||||
client := &http.Client{Transport: noVerifyTransport}
|
||||
client := new(http.Client{Transport: noVerifyTransport})
|
||||
|
||||
if conf.DebugHTTP {
|
||||
client = &http.Client{
|
||||
Transport: &cfg.DebugTransport{
|
||||
Transport: noVerifyTransport}}
|
||||
client = new(http.Client{
|
||||
Transport: new(cfg.DebugTransport{
|
||||
Transport: noVerifyTransport})})
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(verb, conf.DefaultCluster.Uri+path, bytes.NewBuffer([]byte(data)))
|
||||
@@ -528,7 +528,7 @@ func getApiExample(op *Op) string {
|
||||
// otherwise showpath+verb have to match precisely.
|
||||
func matchOperation(showpath, verb string) (*Op, error) {
|
||||
ops := []*Op{}
|
||||
op := &Op{}
|
||||
op := new(Op{})
|
||||
|
||||
var found bool
|
||||
|
||||
|
||||
Reference in New Issue
Block a user