ipbl/vendor/xorm.io/xorm/internal/utils/builder.go
Paul Lecuq 3fd0689366
All checks were successful
continuous-integration/drone/push Build is passing
updated dependencies
2022-06-05 23:07:32 +02:00

28 lines
552 B
Go

// Copyright 2022 The Xorm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package utils
import (
"fmt"
"xorm.io/builder"
)
type BuildReader interface {
String() string
Args() []interface{}
}
// WriteBuilder writes writers to one
func WriteBuilder(w *builder.BytesWriter, inputs ...BuildReader) error {
for _, input := range inputs {
if _, err := fmt.Fprint(w, input.String()); err != nil {
return err
}
w.Append(input.Args()...)
}
return nil
}