packer-cn/builder/vsphere/common/common_test.go

20 lines
428 B
Go

package common
import (
"bytes"
"strings"
"github.com/hashicorp/packer-plugin-sdk/multistep"
packersdk "github.com/hashicorp/packer-plugin-sdk/packer"
)
func basicStateBag(errorBuffer *strings.Builder) *multistep.BasicStateBag {
state := new(multistep.BasicStateBag)
state.Put("ui", &packersdk.BasicUi{
Reader: new(bytes.Buffer),
Writer: new(bytes.Buffer),
ErrorWriter: errorBuffer,
})
return state
}