mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os
This commit is contained in:
		@@ -24,8 +24,8 @@ package framework
 | 
			
		||||
import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"math/rand"
 | 
			
		||||
	"os"
 | 
			
		||||
	"path"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
@@ -328,7 +328,7 @@ func printSummaries(summaries []TestDataSummary, testBaseName string) {
 | 
			
		||||
			} else {
 | 
			
		||||
				// TODO: learn to extract test name and append it to the kind instead of timestamp.
 | 
			
		||||
				filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+"_"+testBaseName+"_"+now.Format(time.RFC3339)+".txt")
 | 
			
		||||
				if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintHumanReadable()), 0644); err != nil {
 | 
			
		||||
				if err := os.WriteFile(filePath, []byte(summaries[i].PrintHumanReadable()), 0644); err != nil {
 | 
			
		||||
					Logf("Failed to write file %v with test performance data: %v", filePath, err)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
@@ -345,7 +345,7 @@ func printSummaries(summaries []TestDataSummary, testBaseName string) {
 | 
			
		||||
				// TODO: learn to extract test name and append it to the kind instead of timestamp.
 | 
			
		||||
				filePath := path.Join(TestContext.ReportDir, summaries[i].SummaryKind()+"_"+testBaseName+"_"+now.Format(time.RFC3339)+".json")
 | 
			
		||||
				Logf("Writing to %s", filePath)
 | 
			
		||||
				if err := ioutil.WriteFile(filePath, []byte(summaries[i].PrintJSON()), 0644); err != nil {
 | 
			
		||||
				if err := os.WriteFile(filePath, []byte(summaries[i].PrintJSON()), 0644); err != nil {
 | 
			
		||||
					Logf("Failed to write file %v with test performance data: %v", filePath, err)
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user