MCPcopy Index your code
hub / github.com/docker/cli / writeFile

Function writeFile

cli/command/swarm/ca_test.go:68–78  ·  view source on GitHub ↗
(dir, data string)

Source from the content-addressed store, hash-verified

66}
67
68func writeFile(dir, data string) (string, error) {
69 tmpFile, err := os.CreateTemp(dir, "testfile")
70 if err != nil {
71 return "", err
72 }
73 _, err = tmpFile.WriteString(data)
74 if err != nil {
75 return "", err
76 }
77 return tmpFile.Name(), tmpFile.Close()
78}
79
80func TestDisplayTrustRootInvalidFlags(t *testing.T) {
81 // we need an actual PEMfile to test

Calls 2

NameMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…