cast icon indicating copy to clipboard operation
cast copied to clipboard

Support cast defined type

Open atsushi-ishibashi opened this issue 2 years ago • 0 comments

// 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 

atsushi-ishibashi avatar Nov 18 '22 06:11 atsushi-ishibashi