mirror of
				https://github.com/NVIDIA/nvidia-container-toolkit
				synced 2025-06-26 18:18:24 +00:00 
			
		
		
		
	Address ioutil deprecation
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
		
							parent
							
								
									73749285d5
								
							
						
					
					
						commit
						2fad708556
					
				| @ -3,7 +3,7 @@ package main | ||||
| import ( | ||||
| 	"bytes" | ||||
| 	"encoding/json" | ||||
| 	"io/ioutil" | ||||
| 	"io" | ||||
| 	"log" | ||||
| 	"os" | ||||
| 	"os/exec" | ||||
| @ -188,7 +188,7 @@ func (c testConfig) getRuntimeSpec() (specs.Spec, error) { | ||||
| 	} | ||||
| 	defer jsonFile.Close() | ||||
| 
 | ||||
| 	jsonContent, err := ioutil.ReadAll(jsonFile) | ||||
| 	jsonContent, err := io.ReadAll(jsonFile) | ||||
| 	if err != nil { | ||||
| 		return spec, err | ||||
| 	} else if json.Valid(jsonContent) { | ||||
|  | ||||
| @ -20,7 +20,6 @@ import ( | ||||
| 	"bytes" | ||||
| 	"encoding/json" | ||||
| 	"fmt" | ||||
| 	"io/ioutil" | ||||
| 	"os" | ||||
| 
 | ||||
| 	"github.com/NVIDIA/nvidia-container-toolkit/internal/logger" | ||||
| @ -72,7 +71,7 @@ func (b *builder) loadConfig(config string) (*Config, error) { | ||||
| 	} | ||||
| 
 | ||||
| 	b.logger.Infof("Loading config from %v", config) | ||||
| 	readBytes, err := ioutil.ReadFile(config) | ||||
| 	readBytes, err := os.ReadFile(config) | ||||
| 	if err != nil { | ||||
| 		return nil, fmt.Errorf("unable to read config: %v", err) | ||||
| 	} | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user