MCPcopy Create free account
hub / github.com/despiteallobjections/amigo / String

Method String

types/typeset.go:64–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64func (s *_TypeSet) String() string {
65 switch {
66 case s.IsEmpty():
67 return "∅"
68 case s.IsAll():
69 return "𝓤"
70 }
71
72 hasMethods := len(s.methods) > 0
73 hasTerms := s.hasTerms()
74
75 var buf bytes.Buffer
76 buf.WriteByte('{')
77 if s.comparable {
78 buf.WriteString("comparable")
79 if hasMethods || hasTerms {
80 buf.WriteString("; ")
81 }
82 }
83 for i, m := range s.methods {
84 if i > 0 {
85 buf.WriteString("; ")
86 }
87 buf.WriteString(m.String())
88 }
89 if hasMethods && hasTerms {
90 buf.WriteString("; ")
91 }
92 if hasTerms {
93 buf.WriteString(s.terms.String())
94 }
95 buf.WriteString("}")
96 return buf.String()
97}
98
99// ----------------------------------------------------------------------------
100// Implementation

Callers

nothing calls this directly

Calls 5

IsEmptyMethod · 0.95
IsAllMethod · 0.95
hasTermsMethod · 0.95
StringMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected