MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / NewReplacer

Function NewReplacer

internal/shfmt/shfmt.go:23–38  ·  view source on GitHub ↗
(env []string)

Source from the content-addressed store, hash-verified

21}
22
23func NewReplacer(env []string) *Replacer {
24 r := Replacer{
25 envmap: map[string]string{},
26 }
27 if env == nil {
28 env = os.Environ()
29 }
30 for _, e := range env {
31 k, v, _ := strings.Cut(e, "=")
32 if k == "SQLC_AUTH_TOKEN" {
33 continue
34 }
35 r.envmap[k] = v
36 }
37 return &r
38}

Callers 5

NewClientFunction · 0.92
NewFunction · 0.92
NewFunction · 0.92
VetFunction · 0.92
TestReplaceFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestReplaceFunction · 0.68