12345678910111213141516171819202122232425262728293031 |
- package clause
- import "git.sxidc.com/go-tools/utils/strutils"
- type CommonClause struct {
- clause string
- args []any
- }
- func NewCommonClause(clause string, args ...any) CommonClause {
- return CommonClause{
- clause: clause,
- args: args,
- }
- }
- func (clause CommonClause) Clause() (string, error) {
- if strutils.IsStringEmpty(clause.clause) {
- return "", nil
- }
- return clause.clause + "\n", nil
- }
- func (clause CommonClause) Args() []any {
- if strutils.IsStringEmpty(clause.clause) {
- return make([]any, 0)
- }
- return clause.args
- }
|