THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
352B

  1. // Copyright 2019 The Xorm Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package xorm
  5. func trimQuote(s string) string {
  6. if len(s) == 0 {
  7. return s
  8. }
  9. if s[0] == '`' {
  10. s = s[1:]
  11. }
  12. if len(s) > 0 && s[len(s)-1] == '`' {
  13. return s[:len(s)-1]
  14. }
  15. return s
  16. }