mirror of
https://github.com/hanzoai/insights-go.git
synced 2026-09-30 22:46:12 +00:00
The module declares go 1.27.1 and the adapter image follows. go fix applied the modernizers and left ptrString and ptrBool with no callers, so they are gone; omitzero is not applied, since it changes what the JSON says. Co-authored-by: Hanzo Dev <[email protected]>
19 lines
570 B
Go
19 lines
570 B
Go
package insights
|
|
|
|
// Groups is used to represent groups in messages that support it.
|
|
// It is a free-form object so the application can set any value it sees fit but
|
|
// a few helper methods are defined to make it easier to instantiate groups with
|
|
// common fields.
|
|
type Groups map[string]any
|
|
|
|
// NewGroups creates an empty Groups map for fluent construction.
|
|
func NewGroups() Groups {
|
|
return make(Groups, 10)
|
|
}
|
|
|
|
// Set assigns a group type to a group key or ID and returns the receiver.
|
|
func (p Groups) Set(name string, value any) Groups {
|
|
p[name] = value
|
|
return p
|
|
}
|