MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / AppendToList

Method AppendToList

internal/postgres/parameters.go:127–139  ·  view source on GitHub ↗

AppendToList adds each value to the right-hand side of parameter name as a comma-separated list without quoting.

(name string, value ...string)

Source from the content-addressed store, hash-verified

125// AppendToList adds each value to the right-hand side of parameter name
126// as a comma-separated list without quoting.
127func (ps *ParameterSet) AppendToList(name string, value ...string) {
128 result := ps.Value(name)
129
130 if len(value) > 0 {
131 if len(result) > 0 {
132 result += "," + strings.Join(value, ",")
133 } else {
134 result = strings.Join(value, ",")
135 }
136 }
137
138 ps.Add(name, result)
139}
140
141// Get returns the value of parameter name and whether or not it was present in ps.
142func (ps *ParameterSet) Get(name string) (string, bool) {

Callers 3

PostgreSQLParametersFunction · 0.80
PostgreSQLParametersFunction · 0.80

Calls 2

ValueMethod · 0.95
AddMethod · 0.95

Tested by 1