mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Remove ioutil (#18222)
				
					
				
			- Don't use `ioutil` package anymore as it doesn't anything special anymore since Go 1.16: ``` // As of Go 1.16, the same functionality is now provided // by package io or package os, and those implementations // should be preferred in new code. ``` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -8,7 +8,6 @@ import (
 | 
			
		||||
	"context"
 | 
			
		||||
	"database/sql"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io/ioutil"
 | 
			
		||||
	"os"
 | 
			
		||||
	"path"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
@@ -58,7 +57,7 @@ func TestMain(m *testing.M) {
 | 
			
		||||
		setting.CustomConf = giteaConf
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tmpDataPath, err := ioutil.TempDir("", "data")
 | 
			
		||||
	tmpDataPath, err := os.MkdirTemp("", "data")
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		fmt.Printf("Unable to create temporary data path %v\n", err)
 | 
			
		||||
		os.Exit(1)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user