Go

Go

Made by DeepSource

Using a deprecated function, variable, constant or field from net package GO-W1011

Anti-pattern
Major
Autofix

Sometimes a function, variable, constant, field, or whole package becomes redundant or unnecessary but must be kept for compatibility with existing programs. These should not be used except for compatibility with legacy systems.

Bad practice

network, addr := "", ""
tr := http.Transport{}
tr.Dial(network, addr)
tr.DialTLS(network, addr)

Recommended

ctx := context.TODO()
network, addr := "", ""
tr := http.Transport{}
tr.DialContext(ctx, network, addr)
tr.DialTLSContext(ctx, network, addr)