“Interface pour chaîner Golang” Réponses codées

Interface pour chaîner Golang

var x interface{} = "abc"
str := fmt.Sprintf("%v", x)
Bugs Bunny

Interface à la chaîne à Golang

var x interface{} = []int{1, 2, 3}
str1 := fmt.Sprintf("%v", x)
str2 := x.(string)

fmt.Println(str1)
fmt.Println(str2)
Restu Wahyu Saputra

Réponses similaires à “Interface pour chaîner Golang”

Questions similaires à “Interface pour chaîner Golang”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code