Skip to content

Provide a GetString to get string type instead of byte slice #53

@goodspark

Description

@goodspark

Could we get a function to just return the string type instead of a byte slice?

I often just need the string and noticed GetStringByte is actually converting the underlying string to a byte.

func (v *Value) GetString(keys ...string) string {
  v = v.Get(keys...)
  if v == nil || v.Type() != TypeString {
    return ""
  }
  return v.s
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions