Skip to content

Support cast defined type  #160

@atsushi-ishibashi

Description

@atsushi-ishibashi
// 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 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions