cast
cast copied to clipboard
Support cast defined type
// You can edit this code!
// Click here and start typing.
package main
import (
"fmt"
"github.com/spf13/cast"
)
type Hoge = string
type Fuga string
func main() {
h := Hoge("hoge")
f := Fuga("fuga")
fmt.Println(h, f)
fmt.Println(cast.ToString(h), cast.ToString(f))
}
// output
hoge fuga
hoge