mirror of
https://github.com/luxfi/utils.git
synced 2026-10-30 15:13:57 +00:00
Add wrappers package with Packer, Errs, and Closer types for binary serialization and error handling. These are needed by other Lux packages that were previously importing from vm. Add bimap package for bidirectional maps. Update atomic.go to re-export from standalone atomic module.
22 lines
383 B
Go
22 lines
383 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package wrappers
|
|
|
|
type Errs struct{ Err error }
|
|
|
|
func (errs *Errs) Errored() bool {
|
|
return errs.Err != nil
|
|
}
|
|
|
|
func (errs *Errs) Add(errors ...error) {
|
|
if errs.Err == nil {
|
|
for _, err := range errors {
|
|
if err != nil {
|
|
errs.Err = err
|
|
break
|
|
}
|
|
}
|
|
}
|
|
}
|