mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-04 14:18:20 +08:00 
			
		
		
		
	function PrintSlice supports Generics
This commit is contained in:
		@ -11,7 +11,8 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
func PrintSlice(nums []int) {
 | 
			
		||||
// PrintSlice Print a slice
 | 
			
		||||
func PrintSlice[T any](nums []T) {
 | 
			
		||||
	fmt.Printf("%v", nums)
 | 
			
		||||
	fmt.Println()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user