mirror of
https://github.com/Icinga/icingadb.git
synced 2026-06-06 15:22:08 -04:00
Merge pull request #356 from Icinga/bugfix/mustpackany
Clarify what MustPackAny() does
This commit is contained in:
commit
4371d04d5e
2 changed files with 4 additions and 4 deletions
|
|
@ -11,11 +11,11 @@ import (
|
|||
"sort"
|
||||
)
|
||||
|
||||
// MustPackAny calls PackAny using in and panics if there was an error.
|
||||
func MustPackAny(in ...interface{}) []byte {
|
||||
// MustPackSlice calls PackAny using items and panics if there was an error.
|
||||
func MustPackSlice(items ...interface{}) []byte {
|
||||
var buf bytes.Buffer
|
||||
|
||||
if err := PackAny(in, &buf); err != nil {
|
||||
if err := PackAny(items, &buf); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func FlattenCustomvars(ctx context.Context, cvs <-chan contracts.Entity) (<-chan
|
|||
IdMeta: IdMeta{
|
||||
// TODO(el): Schema comment is wrong.
|
||||
// Without customvar.Id we would produce duplicate keys here.
|
||||
Id: utils.Checksum(objectpacker.MustPackAny(customvar.EnvironmentId, customvar.Id, flatname, flatvalue)),
|
||||
Id: utils.Checksum(objectpacker.MustPackSlice(customvar.EnvironmentId, customvar.Id, flatname, flatvalue)),
|
||||
},
|
||||
},
|
||||
EnvironmentMeta: EnvironmentMeta{
|
||||
|
|
|
|||
Loading…
Reference in a new issue