Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cast defined type #160

Open
atsushi-ishibashi opened this issue Nov 18, 2022 · 0 comments
Open

Support cast defined type #160

atsushi-ishibashi opened this issue Nov 18, 2022 · 0 comments

Comments

@atsushi-ishibashi
Copy link

// 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 atsushi-ishibashi changed the title Support defined type cast Support cast defined type Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant