ioutil.ReadFile is deprecated, use os.ReadFile instead
1326 return mapping, nil
1327 }
1328
1329 content, err := ioutil.ReadFile(path)1330 if err != nil {
1331 return nil, err
1332 }
ioutil.ReadFile is deprecated, use os.ReadFile instead
1288 return nil
1289 }
1290
1291 content, err := ioutil.ReadFile(path)1292 if err != nil {
1293 return fmt.Errorf("failed to open RBAC config file (%s): %w", cmd.ConfigRBAC, err)
1294 }
ioutil.ReadFile is deprecated, use os.ReadFile instead
537 atc.DefaultWebhookInterval = cmd.ResourceWithWebhookCheckingInterval
538
539 if cmd.BaseResourceTypeDefaults.Path() != "" {
540 content, err := ioutil.ReadFile(cmd.BaseResourceTypeDefaults.Path()) 541 if err != nil {
542 return nil, err
543 }
ioutil.ReadFile is deprecated, use os.ReadFile instead
1474
1475 if cmd.isMTLSEnabled() {
1476 tlsLogger.Debug("mTLS-Enabled")
1477 clientCACert, err := ioutil.ReadFile(string(cmd.TLSCaCert))1478 if err != nil {
1479 return nil, err
1480 }
Description
io/ioutil
package, like most things with util in the name, has turned out to
be a poorly defined and complex to understand the collection of things.
In a series of a few changes, the entire ioutil package will become deprecated starting from Go 1.16.
Existing code using ioutil will continue to work; ioutil will consist of simple wrappers to new functions which reside in the io and os packages.
Bad practice
ioutil.ReadAll(r)
ioutil.ReadFile(filename)
ioutil.ReadDir(dirname)
// ...
Recommended
io.ReadAll(r)
os.ReadFile(filename)
os.ReadDir(dirname)
// ...