String returns the canonical "provider/model" representation. When either component is empty the separator is still emitted so the output round-trips through [ParseID] only when both fields are set. For the zero ID the result is the empty string.
()
| 57 | // output round-trips through [ParseID] only when both fields are set. |
| 58 | // For the zero ID the result is the empty string. |
| 59 | func (id ID) String() string { |
| 60 | if id.IsZero() { |
| 61 | return "" |
| 62 | } |
| 63 | return id.Provider + "/" + id.Model |
| 64 | } |
| 65 | |
| 66 | // IsZero reports whether the ID has both components empty. |
| 67 | func (id ID) IsZero() bool { |