name.go 675 B

12345678910111213141516171819202122232425262728293031
  1. package spec
  2. // Name returns a basic string, such as int32,int64
  3. func (t PrimitiveType) Name() string {
  4. return t.RawName
  5. }
  6. // Name returns a structure string, such as User
  7. func (t DefineStruct) Name() string {
  8. return t.RawName
  9. }
  10. // Name returns a map string, such as map[string]int
  11. func (t MapType) Name() string {
  12. return t.RawName
  13. }
  14. // Name returns a slice string, such as []int
  15. func (t ArrayType) Name() string {
  16. return t.RawName
  17. }
  18. // Name returns a pointer string, such as *User
  19. func (t PointerType) Name() string {
  20. return t.RawName
  21. }
  22. // Name returns a interface string, Its fixed value is interface{}
  23. func (t InterfaceType) Name() string {
  24. return t.RawName
  25. }