MCPcopy
hub / github.com/tinylib/msgp / BaseType

Method BaseType

gen/elem.go:778–814  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

776}
777
778func (s *BaseElem) BaseType() string {
779 switch s.Value {
780 case IDENT:
781 return s.alias
782
783 // exceptions to the naming/capitalization
784 // rule:
785 case Intf:
786 return "interface{}"
787 case Bytes:
788 return "[]byte"
789 case Time:
790 return "time.Time"
791 case Duration:
792 return "time.Duration"
793 case JsonNumber:
794 return "json.Number"
795 case AInt64:
796 return "atomic.Int64"
797 case AUint64:
798 return "atomic.Uint64"
799 case AInt32:
800 return "atomic.Int32"
801 case AUint32:
802 return "atomic.Uint32"
803 case ABool:
804 return "atomic.Bool"
805
806 case Ext:
807 return "msgp.Extension"
808
809 // everything else is base.String() with
810 // the first letter as lowercase
811 default:
812 return strings.ToLower(s.BaseName())
813 }
814}
815
816func (s *BaseElem) Needsref(b bool) {
817 s.needsref = b

Callers 7

TypeNameMethod · 0.95
ToBaseMethod · 0.95
gBaseMethod · 0.80
gBaseMethod · 0.80
gBaseMethod · 0.80
gBaseMethod · 0.80
gBaseMethod · 0.80

Calls 1

BaseNameMethod · 0.95

Tested by

no test coverage detected