acces to string on enum
This commit is contained in:
parent
8c97fca96c
commit
eb1417853a
@ -21,6 +21,10 @@ const (
|
|||||||
WORKSPACE = utils.WORKSPACE
|
WORKSPACE = utils.WORKSPACE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func (d LibDataEnum) String() string {
|
||||||
|
return utils.Str[d]
|
||||||
|
}
|
||||||
|
|
||||||
func (d LibDataEnum) EnumIndex() int {
|
func (d LibDataEnum) EnumIndex() int {
|
||||||
return int(d)
|
return int(d)
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ const (
|
|||||||
WORKSPACE
|
WORKSPACE
|
||||||
)
|
)
|
||||||
|
|
||||||
var str = [...]string{
|
var Str = [...]string{
|
||||||
"invalid",
|
"invalid",
|
||||||
"data_resource",
|
"data_resource",
|
||||||
"processing_resource",
|
"processing_resource",
|
||||||
@ -27,11 +27,11 @@ var str = [...]string{
|
|||||||
}
|
}
|
||||||
|
|
||||||
func FromInt(i int) string {
|
func FromInt(i int) string {
|
||||||
return str[i]
|
return Str[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d DataType) String() string {
|
func (d DataType) String() string {
|
||||||
return str[d]
|
return Str[d]
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnumIndex - Creating common behavior - give the type a EnumIndex functio
|
// EnumIndex - Creating common behavior - give the type a EnumIndex functio
|
||||||
|
Loading…
Reference in New Issue
Block a user