github.com/acoshift/pgsql@v0.15.3/pgstmt/util_test.go (about)

     1  package pgstmt_test
     2  
     3  import (
     4  	"strings"
     5  )
     6  
     7  func stripSpace(s string) string {
     8  	s = strings.ReplaceAll(s, "\n", " ")
     9  	s = strings.ReplaceAll(s, "\t", " ")
    10  	s = strings.TrimSpace(s)
    11  	for {
    12  		p := strings.ReplaceAll(s, "  ", " ")
    13  		if s == p {
    14  			break
    15  		}
    16  		s = p
    17  	}
    18  	s = strings.ReplaceAll(s, "( ", "(")
    19  	s = strings.ReplaceAll(s, " )", ")")
    20  	return s
    21  }