mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
This commit is contained in:
		| @@ -34,7 +34,6 @@ import ( | ||||
| 	"code.gitea.io/gitea/modules/timeutil" | ||||
| 	"code.gitea.io/gitea/modules/util" | ||||
|  | ||||
| 	"github.com/unknwon/com" | ||||
| 	"xorm.io/builder" | ||||
| ) | ||||
|  | ||||
| @@ -85,7 +84,7 @@ func loadRepoConfig() { | ||||
| 			} | ||||
|  | ||||
| 			for _, f := range customFiles { | ||||
| 				if !com.IsSliceContainsStr(files, f) { | ||||
| 				if !util.IsStringInSlice(f, files, true) { | ||||
| 					files = append(files, f) | ||||
| 				} | ||||
| 			} | ||||
| @@ -115,12 +114,12 @@ func loadRepoConfig() { | ||||
| 	// Filter out invalid names and promote preferred licenses. | ||||
| 	sortedLicenses := make([]string, 0, len(Licenses)) | ||||
| 	for _, name := range setting.Repository.PreferredLicenses { | ||||
| 		if com.IsSliceContainsStr(Licenses, name) { | ||||
| 		if util.IsStringInSlice(name, Licenses, true) { | ||||
| 			sortedLicenses = append(sortedLicenses, name) | ||||
| 		} | ||||
| 	} | ||||
| 	for _, name := range Licenses { | ||||
| 		if !com.IsSliceContainsStr(setting.Repository.PreferredLicenses, name) { | ||||
| 		if !util.IsStringInSlice(name, setting.Repository.PreferredLicenses, true) { | ||||
| 			sortedLicenses = append(sortedLicenses, name) | ||||
| 		} | ||||
| 	} | ||||
| @@ -1933,7 +1932,7 @@ func repoStatsCheck(ctx context.Context, checker *repoChecker) { | ||||
| 		return | ||||
| 	} | ||||
| 	for _, result := range results { | ||||
| 		id := com.StrTo(result["id"]).MustInt64() | ||||
| 		id, _ := strconv.ParseInt(string(result["id"]), 10, 64) | ||||
| 		select { | ||||
| 		case <-ctx.Done(): | ||||
| 			log.Warn("CheckRepoStats: Cancelled before checking %s for Repo[%d]", checker.desc, id) | ||||
| @@ -2001,7 +2000,7 @@ func CheckRepoStats(ctx context.Context) error { | ||||
| 		log.Error("Select %s: %v", desc, err) | ||||
| 	} else { | ||||
| 		for _, result := range results { | ||||
| 			id := com.StrTo(result["id"]).MustInt64() | ||||
| 			id, _ := strconv.ParseInt(string(result["id"]), 10, 64) | ||||
| 			select { | ||||
| 			case <-ctx.Done(): | ||||
| 				log.Warn("CheckRepoStats: Cancelled during %s for repo ID %d", desc, id) | ||||
| @@ -2024,7 +2023,7 @@ func CheckRepoStats(ctx context.Context) error { | ||||
| 		log.Error("Select %s: %v", desc, err) | ||||
| 	} else { | ||||
| 		for _, result := range results { | ||||
| 			id := com.StrTo(result["id"]).MustInt64() | ||||
| 			id, _ := strconv.ParseInt(string(result["id"]), 10, 64) | ||||
| 			select { | ||||
| 			case <-ctx.Done(): | ||||
| 				log.Warn("CheckRepoStats: Cancelled") | ||||
| @@ -2047,7 +2046,7 @@ func CheckRepoStats(ctx context.Context) error { | ||||
| 		log.Error("Select repository count 'num_forks': %v", err) | ||||
| 	} else { | ||||
| 		for _, result := range results { | ||||
| 			id := com.StrTo(result["id"]).MustInt64() | ||||
| 			id, _ := strconv.ParseInt(string(result["id"]), 10, 64) | ||||
| 			select { | ||||
| 			case <-ctx.Done(): | ||||
| 				log.Warn("CheckRepoStats: Cancelled") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user