Skip to content

Conversation

idersec
Copy link
Collaborator

@idersec idersec commented Dec 6, 2022

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

You can use trim clause to remove the keywords at the beginning or end of a SQL segment, including and,or,xor,,

User Case Description

type TrimTest interface {
// TestTrim
//
// select * from @@table where
//    {{trim}}
//        {{for _, name :=range list}}
//            name = @name or
//        {{end}}
//    {{end}}
TestTrim(list []string)[]gen.T
}

return
}
res.Value = append(res.Value, trimClause)
s.appendTmpl(trimClause.Finish(res.VarName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line is not formatted?

return
}
res.Value = append(res.Value, trimClause)
s.appendTmpl(trimClause.Finish(res.VarName))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this line not formatted too.

@idersec idersec merged commit 8b6f628 into master Jan 4, 2023
@jinzhu jinzhu deleted the trim branch January 4, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants