PORT / github.com/packvium/packvium-go
Go port
The reference engine reimplemented in Go, standard library only, and byte-identical to the reference on the 1.3.0 conformance corpus.
INSTALL
go get github.com/packvium/packvium-goFIRST CALL
// go get github.com/packvium/packvium-go
bookSize, _ := domain.DimensionsOf("210", "140", "30", "mm")
boxSize, _ := domain.DimensionsOf("400", "300", "250", "mm")
spec := domain.NewItemSpec("book", bookSize)
spec.Quantity = 4
book, err := domain.NewItem(spec)
if err != nil {
log.Fatal(err)
}
box, err := domain.NewContainer(domain.ContainerSpec{ID: "box", InnerDimensions: boxSize})
if err != nil {
log.Fatal(err)
}
balanced, _ := config.New(config.Default(config.Balanced))
result, err := packer.New(balanced, algorithm.NoExtensions()).Pack([]*domain.Item{book}, []*domain.Container{box})
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Status) // feasible- Version
- 1.3.0
- Requires
- Go >= 1.13
- License
- MIT
- Role
- Port
- Registry
- Go modules
- Availability
- published
EVIDENCE
Held to the same fixtures as every other engine.
Released on its own line, not with the suite: 1.3.0 implements the 1.3.0 contract, so request fields added in 1.4 and later (a pallet overhang limit, for one) are not in it yet and are refused with unsupported_feature.